app3

Dependencies:   mbed

Fork of Code_APP1 by Louis Beaulieu

Revision:
7:a57409bdf777
Parent:
6:2ec2a74c807f
Child:
8:6f2b7f9b0d0d
--- a/main.cpp	Mon Jan 16 21:37:15 2017 +0000
+++ b/main.cpp	Mon Jan 16 22:23:21 2017 +0000
@@ -25,15 +25,16 @@
 int main() {
     int addrChip = 0x3A;
     char buffer[3] = {0,0,0};
-    
-    *power_ptr = PCUART0;
-    *enableDataFlow_ptr = TXE0;
-    *clk_ptr = PCLK_UART0;
-    *baudRate_ptr = DLAB_ACTIVATE;
-    *baudRate_ptr = DLMSB;
-    *baudRate_ptr = DLLSB;
-    *enableFIFO_ptr = FIFO_ACTIVATE;
-    *pinSelect_ptr = PIN9_TX;
+    //*clk_ptr |= PCLK_UART0;
+    pc.printf("main() clk_ptr");
+    //*baudRate_ptr |= DLAB_ACTIVATE;
+    pc.printf("main() DLAB_ACTIVATE");
+    //*baudRate_ptr |= DLMSB;
+    pc.printf("main() DLMSB");
+    //*baudRate_ptr |= DLLSB;
+    pc.printf("main() DLLSB");
+    //*enableFIFO_ptr |= FIFO_ACTIVATE;
+    pc.printf("main() FIFO_ACTIVATE");
     
     SetClockAndMode(250000, 0);
     change_dots(0x02);
@@ -73,6 +74,15 @@
     }
 }
 
+void write_uart(char value)
+{
+    /*
+    *U0THR |= value;
+    *pinSelect_ptr |= PIN9_TX;
+    *enableDataFlow_ptr |= TXE0;
+    */
+}
+
 // function to change displayed dots
 void change_dots(char dot)
 {
@@ -83,7 +93,8 @@
     }
     else
     {
-        // TODO
+        write_uart(0x77);
+        write_uart(dot);
     }
 }
 
@@ -96,7 +107,8 @@
     }
     else
     {
-        // TODO
+        write_uart(0x79);
+        write_uart(0);
     }
 }
 
@@ -113,7 +125,10 @@
     }
     else
     {
-        // TODO
+        write_uart(d1);
+        write_uart(d2);
+        write_uart(d3);
+        write_uart(d4);
     }
 }