![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
FRDM-K64 ADC demo
main.cpp@0:0a57f4a13cda, 2014-07-09 (annotated)
- Committer:
- APanecatl
- Date:
- Wed Jul 09 19:29:37 2014 +0000
- Revision:
- 0:0a57f4a13cda
rev 1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
APanecatl | 0:0a57f4a13cda | 1 | #include "mbed.h" |
APanecatl | 0:0a57f4a13cda | 2 | |
APanecatl | 0:0a57f4a13cda | 3 | AnalogIn AnIn(A0); |
APanecatl | 0:0a57f4a13cda | 4 | DigitalOut led(LED1); |
APanecatl | 0:0a57f4a13cda | 5 | |
APanecatl | 0:0a57f4a13cda | 6 | Serial pc(USBTX,USBRX); |
APanecatl | 0:0a57f4a13cda | 7 | |
APanecatl | 0:0a57f4a13cda | 8 | float x; |
APanecatl | 0:0a57f4a13cda | 9 | int main() |
APanecatl | 0:0a57f4a13cda | 10 | { |
APanecatl | 0:0a57f4a13cda | 11 | pc.printf(" ADC demo code\r\n"); |
APanecatl | 0:0a57f4a13cda | 12 | while (1) |
APanecatl | 0:0a57f4a13cda | 13 | { |
APanecatl | 0:0a57f4a13cda | 14 | x=AnIn.read(); |
APanecatl | 0:0a57f4a13cda | 15 | pc.printf("ADC0_Ch12=(%d)\r\n", x); |
APanecatl | 0:0a57f4a13cda | 16 | wait(.2); |
APanecatl | 0:0a57f4a13cda | 17 | } |
APanecatl | 0:0a57f4a13cda | 18 | } |