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.
Dependencies: mbed
Fork of PE_05-04_LoggingData by
Diff: main.cpp
- Revision:
- 1:a8d819e5c10d
- Parent:
- 0:ec4e2bc1996f
--- a/main.cpp Mon Oct 15 21:18:35 2012 +0000
+++ b/main.cpp Tue Nov 18 12:40:35 2014 +0000
@@ -2,16 +2,18 @@
*/
#include "mbed.h"
Serial pc(USBTX, USBRX); //enable serial port which links to USB
-AnalogIn Ain(p20);
+AnalogIn Ain(A0);
-float ADCdata;
-
+unsigned int ADCdata;
+float LightVolts;
int main() {
pc.printf("ADC Data Values...\n\r"); //send an opening text message
while(1){
- ADCdata=Ain;
+ ADCdata=Ain.read_u16();
+ //LightVolts=ADCdata*3.3;
wait(0.5);
- pc.printf("%1.3f \n\r",ADCdata); //send the data to the terminal
+// pc.printf("%1.3f \n\r",LightVolts); //send the data to the terminal
+ pc.printf("%x \n\r",ADCdata); //send the data to the terminal
}
}
