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
Revision 1:a8d819e5c10d, committed 2014-11-18
- Comitter:
- Richard37
- Date:
- Tue Nov 18 12:40:35 2014 +0000
- Parent:
- 0:ec4e2bc1996f
- Commit message:
- This looks at various AD input formats
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- 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
}
}
--- a/mbed.bld Mon Oct 15 21:18:35 2012 +0000 +++ b/mbed.bld Tue Nov 18 12:40:35 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/cd19af002ccc \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89 \ No newline at end of file
