test00

Dependencies:   MCP4725 mbed

Fork of test01 by Four Squared

Revision:
1:c5360811157c
Parent:
0:77006df50c28
Child:
2:76f0ff8c3068
diff -r 77006df50c28 -r c5360811157c main.cpp
--- a/main.cpp	Wed Nov 02 15:41:23 2016 +0000
+++ b/main.cpp	Wed Nov 02 17:56:38 2016 +0000
@@ -24,14 +24,26 @@
 {
     // Print to terminal
     pc.printf("Ready.......FIGHT!\r\n");
+    double freqf;
+    // if statement
+    //freqf = 0.5;
+    freqf = 0.05;
+ 
+ 
+ 
+ 
  
     while(1) {
+        
         testLed = 1;
-        wait(0.5);
+        wait(freqf);
         // Write to DAC register (not EEPROM). Documentation in library files.
-        bacon.write(MCP4725::Normal, (0xFFF * (1.0/3.3) ), false);
+        bacon.write(MCP4725::Normal, (0xFFF * (1.0/3.32) ), false);
         testLed = 0;
-        wait(0.5);
+        pc.printf("Value is %f V \r\n",analogIn.read()*3.3);
+        wait(freqf);
+        bacon.write(MCP4725::Normal, (0x000 * (1.0/3.3) ), false);
+        
         // Print ADC measurement to terminal. Scale factor of 3.3 needed for internal ADC.
         pc.printf("Value is %f V \r\n",analogIn.read()*3.3);
     }