:)

Dependencies:   MbedJSONValue DebounceIn TextLCD USBDevice mbed WebSocketClient cc3000_hostdriver_mbedsocket Adafruit_LEDBackpack_2

Files at this revision

API Documentation at this revision

Comitter:
ddrew73
Date:
Mon Dec 01 18:27:08 2014 +0000
Parent:
7:7fbe8dc5e4fa
Child:
9:5fa90677ff3e
Child:
12:c4b046975527
Commit message:
Added debugging printfs;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Nov 26 00:39:46 2014 +0000
+++ b/main.cpp	Mon Dec 01 18:27:08 2014 +0000
@@ -4,11 +4,16 @@
 #include "Adafruit_GFX.h"
 #include "TextLCD.h"
 #include "DebounceIn.h"
-#include "USBKeyboard.h"
 #include "cc3000.h"
 #include "Websocket.h"
 #include "MbedJSONValue.h"
 
+//Debug
+Serial pc(USBTX, USBRX); // tx, rx
+
+//For oscilliscope
+Timer timer;
+
 //LED stuff
 I2C i2c_left(D7,D6);
 Adafruit_24bargraph ledbar_left=Adafruit_24bargraph(&i2c_left);
@@ -39,7 +44,7 @@
 AnalogOut dac(PTE30);
 AnalogIn  adc(PTB0);
 
-//USBKeyboard keyboard;
+
 
 
 //LCD stuff
@@ -70,9 +75,6 @@
     float volt_mat[24][2] = {};
     float clientdata[48] = {};
     float rowval = 0, vddval = 0;
-    
-    //dac = test_val;
-
 
     //LED init
     int rowselect = 0, moved = 1, colselect = 0, selected = 0;
@@ -100,7 +102,7 @@
             ledbar_right.writeDisplay();
         } 
         else {
-            ledbar_left.clear();
+        ledbar_left.clear();
         ledbar_right.clear();
         ledbar_right.setBar(rowselect,LED_GREEN);
         ledbar_right.writeDisplay();
@@ -241,9 +243,21 @@
                 demo["selected"] = selected;
                 
                 
-                
                 moved = 0;
                 
+                //DEBUGGING TOOLS //////////////
+                pc.printf("\n%1.3f %1.3f \n", vddval, rowval); 
+                for (int i = 0; i<48; i++){
+                pc.printf(" %1.3f ", clientdata[i]);
+                }
+                pc.printf(" \n \n ");
+                for (int x = 0; x < 2; x++) {
+                for (int y = 0; y < 24; y++) {
+                pc.printf("%1.3f \n", volt_mat[x][y]);
+                }}
+                ////////////////////////
+                
+                 
                 wait(2);  //THIS NEEDS TO GO AWAY! :}
                 
                 } // END OF SCANBUTTON IF STATEMENT
@@ -287,7 +301,48 @@
     }  // END OF INT MAIN
 
 
+/*
+FLOAT NODE CHECKER
+ add another "for" around the two for the 48 row checker:
+
+if (u == 0){
+old_volt_map[x,y] = in_val
+}
+else{
+volt_map[x,y] = in_val
+if (old_volt_map[x,y] != volt_map[x,y] ) {
+    volt_map[x,y] = 100;
+    }
+
+PUT ALL ROW LIGHTING (CON_MAT) STUFF HERE
+}
+
+*/
+
+/*
+OSCILLISCOPE
 
 
+while (scanbutton == 0){
+if (loopcount = 0){
+timer.reset();
+timer.start();
+begintime = timer.read_ms();
+pressed == 1;
+}
 
+ADD VOLTAGE TO OSCI BUFFER
 
+loopcount = loopcount +1;
+} // BREAK THE WHILE SCANBUTTON
+
+if (pressed == 1){
+timer.stop();
+endtime = timer.read_ms();
+
+DO ENTIRE SCAN STUFF
+
+pressed = 0;
+}
+
+*/
\ No newline at end of file