How to use ads1015.
Dependencies: ADS1015 USBDevice mbed
Diff: main.cpp
- Revision:
- 1:3557be903240
- Parent:
- 0:ea70612a3ee1
- Child:
- 2:7dabf69723a3
diff -r ea70612a3ee1 -r 3557be903240 main.cpp --- a/main.cpp Sun Nov 10 18:30:09 2013 +0000 +++ b/main.cpp Wed Nov 20 17:18:34 2013 +0000 @@ -10,10 +10,13 @@ int main() { - uint16_t reading; + ads.setGain(GAIN_SIXTEEN); // set range to +/-0.256V + int16_t reading; while (1) { reading = ads.readADC_SingleEnded(0); // read channel 0 pc.printf("reading: %d\r\n", reading); // print reading wait(2); // loop 2 sek + reading = ads.readADC_Differential_2_3(); + pc.printf("diff a2, a3: %d\r\n", reading); // print diff } } \ No newline at end of file