
AD7606 Library demo
main.cpp
- Committer:
- frada
- Date:
- 2015-01-19
- Revision:
- 0:f0b559912391
- Child:
- 1:ca30c6307824
File content as of revision 0:f0b559912391:
#include "mbed.h" #include "ad7606.h" #ifdef TARGET_KL25Z #define MISO PTD3 #define SCLK PTD1 #define CS PTD0 #define CONVST PTD5 #define BUSY PTD4 #endif Serial pc(USBTX, USBRX); AD7606 ad7606(MISO, SCLK, CS, CONVST, BUSY, 100000); //double analogValues[8] = {0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F}; uint16_t rawValues[8] = {0, 0, 0, 0, 0, 0, 0, 0}; int main() { pc.baud(115200); pc.printf("Hello, World!\r\n"); while(1) { ad7606.readRawValues(rawValues); //pc.printf("%04x, %04x, %04x, %04x, %04x, %04x, %04x, %04x\r\n", rawValues[0], rawValues[1],rawValues[2],rawValues[3],rawValues[4],rawValues[5],rawValues[6],rawValues[7]); wait_ms(100); } }