Alexander Rao / Mbed 2 deprecated object_counter

Dependencies:   mbed mbed-rtos 4DGL-uLCD-SE X_NUCLEO_53L0A1

Files at this revision

API Documentation at this revision

Comitter:
alexhrao
Date:
Thu Apr 18 17:36:20 2019 +0000
Parent:
4:44b4158fc494
Child:
6:b720519bdfe8
Commit message:
Revise virtual LED

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Apr 18 16:43:34 2019 +0000
+++ b/main.cpp	Thu Apr 18 17:36:20 2019 +0000
@@ -93,6 +93,9 @@
 void points(void) {
     int prev_points = -1;
     bool prev_is_point = false;
+    lcd_lock.lock();
+    uLCD.circle(110, 10, 10, GREEN);
+    lcd_lock.unlock();
     while (1) {
         if (time_left <= 0) {
             break;
@@ -109,17 +112,19 @@
         if (is_point && !prev_is_point) {
             // changed from no to yes
             lcd_lock.lock();
-            uLCD.filled_circle(8, 0, 1, GREEN);
+            uLCD.filled_circle(110, 10, 9, GREEN);
             lcd_lock.unlock();
+            prev_is_point = is_point;
         } else if (!is_point && prev_is_point) {
             lcd_lock.lock();
-            uLCD.filled_circle(8, 0, 1, BLACK);
+            uLCD.filled_circle(110, 10, 9, BLACK);
             lcd_lock.unlock();
+            prev_is_point = is_point;
         }
         Thread::wait(100);
     }
     lcd_lock.lock();
-    uLCD.filled_circle(8, 0, 1, RED);
+    uLCD.filled_circle(110, 10, 10, RED);
     lcd_lock.unlock();
 }