:)

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:
Wed Nov 19 23:35:41 2014 +0000
Parent:
0:16d2619002d7
Child:
2:9c23adbfe9af
Commit message:
11/19;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Nov 18 01:20:00 2014 +0000
+++ b/main.cpp	Wed Nov 19 23:35:41 2014 +0000
@@ -1,4 +1,5 @@
 #include "mbed.h"
+#include <string>
 #include "Adafruit_LEDBackpack.h"
 #include "Adafruit_GFX.h"
 #include "TextLCD.h"
@@ -31,7 +32,7 @@
 
 
 //LCD stuff
-//TextLCD lcd(PTD0,PTD5,PTA12,PTD4,PTA2,PTA1,TextLCD::LCD20x4);
+TextLCD lcd(D13,D12,PTA17,PTA16,PTC17,PTC16,TextLCD::LCD20x4);
 
 int main()
 {
@@ -39,6 +40,7 @@
     //Scan init
 
     float test_val = .001;
+    float row_volt = 0;
     int con_mat[8][8] = {};
     int a1,b1,c1,a2,b2,c2;
     //dac = test_val;
@@ -51,26 +53,19 @@
     ledbar.writeDisplay();
 
     //LCD init
-    /*
     lcd.cls();
-    string programname = "Dan's UI Test"
-    float vddmeasure = 3.14259;
-    lcd.printf("%s",programname.c_str());   //Is the .c_str necessary? Some people on stack overflow say so...
-    lcd.locate(0,2);
-    lcd.printf("%1.3f",vddmeasure);
-    */
+    string programname = "Dan's UI Test";
 
-
+    lcd.printf("%s",programname.c_str());
 
     while(1) {
-
-
+        
         //Display
 
-            ledbar.setBar(rowselect_old,LED_OFF);
-            ledbar.setBar(rowselect,LED_GREEN);
-            ledbar.writeDisplay();
-        
+        ledbar.setBar(rowselect_old,LED_OFF);
+        ledbar.setBar(rowselect,LED_GREEN);
+        ledbar.writeDisplay();
+
 
         //Moving the selected row
         if (upbutton.read() == 0) {
@@ -130,13 +125,13 @@
                     //keyboard.printf("%d %d %d\n",a2,b2,c2);
                 }
             }
-            
-                /*
-                for (int x=0;x<8;x++) {
-                for (int y=0;y<8;y++) {
-                    keyboard.printf("%d ",con_mat[x][y]);
-                    }}
-                */
+
+            /*
+            for (int x=0;x<8;x++) {
+            for (int y=0;y<8;y++) {
+                keyboard.printf("%d ",con_mat[x][y]);
+                }}
+            */
             //Displaying all connected rows as red light!
             ledbar.clear();
             for (int i=0; i<8; i++) {
@@ -146,9 +141,21 @@
             }
             ledbar.writeDisplay();
             moved = 0;
+
+            float vddmeasure = 3.14259;
+            float vrowmeasure = 1.1234;
+            lcd.cls();
+            lcd.locate(0,1);
+            lcd.printf("Vdd: %1.1f V",vddmeasure);
+            lcd.locate(0,0);
+            lcd.printf("Row: %1.1f V",vrowmeasure);
+
             wait(2.5);
             ledbar.clear();
             ledbar.writeDisplay();
+            lcd.cls();
+            string programname = "Dan's UI Test";
+            lcd.printf("%s",programname.c_str());
 
         }
     }