Aconno nrf52832 bmc150 test program.

Dependencies:   BMC150 acn_nrf52_saadc adc52832_common

Files at this revision

API Documentation at this revision

Comitter:
jurica238814
Date:
Wed Sep 13 17:55:34 2017 +0000
Parent:
2:51a9b8c6ff17
Commit message:
Blinking error code.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Sep 13 17:38:45 2017 +0000
+++ b/main.cpp	Wed Sep 13 17:55:34 2017 +0000
@@ -77,25 +77,48 @@
     uint8_t magnetometer  = bmc.getRegister(0x40);
     
     uint8_t errorCounter = 0;
+    uint8_t counter = 0;
     
     if(!(light > 5 && light < 92)){
         // Turn RED led on -> ERROR
-        ledR = 0;
+        for(counter=0; counter<10; counter ++){
+            ledR = 0;
+            wait_ms(50);
+            ledR = 1;
+            wait_ms(50);
+        }
         errorCounter ++;
     }
     if(!(temperature > 20 && temperature < 35)){
         // Turn BLUE led on -> ERROR
-        ledB = 0;
+        for(counter=0; counter<10; counter ++){
+            ledB = 0;
+            wait_ms(50);
+            ledB = 1;
+            wait_ms(50);
+        }
         errorCounter ++;
     }
     if(!(accelerometer == 0xFA)){
-        ledR = 0;
-        ledB = 0;
+        for(counter=0; counter<10; counter ++){
+            ledR = 0;
+            ledB = 0;
+            wait_ms(50);
+            ledR = 1;
+            ledB = 1;
+            wait_ms(50);
+        }
         errorCounter ++;
     }
     if(!(magnetometer == 0x32)){
-        ledB = 0;
-        ledG = 0;
+        for(counter=0; counter<10; counter ++){
+            ledB = 0;
+            ledG = 0;
+            wait_ms(50);
+            ledB = 1;
+            ledG = 1;
+            wait_ms(50);
+        }
         errorCounter ++;
     }