HexiWear Bubble level program

Dependencies:   FXOS8700 NeatGUI

This program uses the accelerometer on the Hexiwear device to simulate a bubble level tool. When the X and Y accelerometer values are both zero, the HexiWear LED changes from red to green. Enjoy,

Files at this revision

API Documentation at this revision

Comitter:
Capper
Date:
Fri Aug 26 12:24:29 2016 +0000
Parent:
0:d7a9c9f2bcc1
Commit message:
Added some blank screen time to avoid OLED image burn

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r d7a9c9f2bcc1 -r 9bbb606da2d0 main.cpp
--- a/main.cpp	Thu Aug 18 20:48:07 2016 +0000
+++ b/main.cpp	Fri Aug 26 12:24:29 2016 +0000
@@ -14,6 +14,7 @@
 DigitalOut led3(LED3);
 DigitalOut BOOSTEN(PTC13);  //oled power enable
 int count = 0;
+int count2 = 0;
 extern const uint8_t  Main_screen_bmp[ 36864 ];
 int argb = 0xff000000; 
 int rgbd = 0x00000000;
@@ -71,6 +72,13 @@
         OLED96x96.drawCircle(61-xposg,47+yposg,2,0xff000000); 
         led1 = 0;
         led2 = 1;
+        count2++;
+        if (count2 > 100)
+        {   //blank display to avoid image burn
+            OLED96x96.fillRect(16,0,111,96,0xff000000);//alpha, BGR
+            count2 = 0;
+        }
+            //BOOSTEN = 0;  //turn off display after about 1 minute to avoid image burn
     }
 
 }