Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- futuremax
- Date:
- 2021-07-14
- Revision:
- 1:f1e13a1aab6f
- Parent:
- 0:85f12fbe14dd
File content as of revision 1:f1e13a1aab6f:
#include "mbed.h" // Programed by Seungchan Lee, futuremax7@gmail.com // 2021.07.15. //Serial pc(USBTX, USBRX); static UARTSerial pc(USBTX, USBRX, 115200); InterruptIn drdy(D10); SPI ads1299(D11, D12, D13); // mosi, miso, sclk DigitalOut cs(D9); DigitalOut reset(A1); DigitalOut pwdn(A2); DigitalOut start(A0); int main() { // pc.baud(115200); // GPIO Initialization reset = 1; pwdn = 1; start = 0; cs = 1; // Setup the spi for 8 bit data, high steady state clock, // second edge capture, with a 1MHz clock rate ads1299.format(8,1); ads1299.frequency(5000000); wait(0.1); cs = 0; ads1299.write(0x06); //RESET cs = 1; wait(0.5); // 100 ms cs = 0; ads1299.write(0x11); //SDATAC cs = 1; wait(0.1); // 100 ms printf("start!!!\n"); while(1) { cs = 0; ads1299.write(0x20); ads1299.write(0x00); char buf = ads1299.write(0x00); cs = 1; printf("WHOAMI register = 0x%X\n", buf); wait(0.5); } }