How to use ads1015.
Dependencies: ADS1015 USBDevice mbed
Revision 2:7dabf69723a3, committed 2014-10-11
- Comitter:
- arve0
- Date:
- Sat Oct 11 07:49:48 2014 +0000
- Parent:
- 1:3557be903240
- Commit message:
- use int for both single ended(uint16_t) and differential(int16_t)
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 3557be903240 -r 7dabf69723a3 main.cpp --- a/main.cpp Wed Nov 20 17:18:34 2013 +0000 +++ b/main.cpp Sat Oct 11 07:49:48 2014 +0000 @@ -9,9 +9,9 @@ USBSerial pc; // USB CDC serial port -int main() { +int main(){ ads.setGain(GAIN_SIXTEEN); // set range to +/-0.256V - int16_t reading; + int reading; while (1) { reading = ads.readADC_SingleEnded(0); // read channel 0 pc.printf("reading: %d\r\n", reading); // print reading