GroupA / Mbed 2 deprecated Lab_6_WaG

Dependencies:   mbed

Fork of WaG by GroupA

Revision:
39:abf211b17e3c
Parent:
32:0dc2b4a3eee6
Child:
42:6cba679a4ee4
--- a/display.cpp	Fri Mar 23 19:32:39 2018 +0000
+++ b/display.cpp	Fri Mar 23 20:16:24 2018 +0000
@@ -25,6 +25,7 @@
 
 extern SPI wag_spi;
 extern spi_cfg as1107;
+extern Serial pc;
 
 /*
  * void initial_setup(struct spi_cfg spi_obj);
@@ -156,15 +157,15 @@
  *      Returns: void
 */
 void test_target_leds() {
-    int pressed = uti_chk_ubutton();
     int led_command = 0;
-    while (pressed == 0);
-    while (pressed == 0) {
-        for (int i = 0x1; i <= 0x8; i++) {
+    while (uti_chk_ubutton() == 0);
+    pc.printf("test begin\n");
+    while (uti_chk_ubutton() == 0) {
+        for (int i = 1; i <= 128; i = i * 2) { 
             led_command = 0x0500 + i;
             spi_send(as1107, led_command); //light up LED[i]
             wait(0.1);
             spi_send(as1107, 0x0500); //turn off LED[i]
         }
     }
-}
\ No newline at end of file
+}