Task 4.4.2

Fork of Task442 by Nicholas Outram

Files at this revision

API Documentation at this revision

Comitter:
noutram
Date:
Tue Feb 13 11:49:20 2018 +0000
Parent:
1:b0f53d2975bd
Child:
3:22fb972026c5
Commit message:
Uses mbed classic library as mbed-os does not seem to work with sleep

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib 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	Thu Jul 13 14:55:06 2017 +0000
+++ b/main.cpp	Tue Feb 13 11:49:20 2018 +0000
@@ -27,7 +27,11 @@
 
         //Sleep
         sleep();
-
+        
+        //READ ADC as an unsigned integer.
+        //Shift right 4 bits (this is a 12bit ADC) & store in static global variable
+        sample16 = POT_ADC_In.read_u16() >> 4;
+        
         //Displauy the sample in HEX
         pc.printf("ADC Value: %X\n", sample16);
  
@@ -39,9 +43,5 @@
 {
     //Toggle on board led
     led = !led;
-
-    //READ ADC as an unsigned integer.
-    //Shift right 4 bits (this is a 12bit ADC) & store in static global variable
-    sample16 = POT_ADC_In.read_u16() >> 4;
 }
 
--- a/mbed-os.lib	Thu Jul 13 14:55:06 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://github.com/ARMmbed/mbed-os/#8828635da469162cf2854b5287561c663fb96e72
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Feb 13 11:49:20 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/7130f322cb7e
\ No newline at end of file