@@ -1170,6 +1170,24 @@ void displayRoverFail(uint16_t displayTime)
1170
1170
}
1171
1171
}
1172
1172
1173
+ void displayAccelFail (uint16_t displayTime)
1174
+ {
1175
+ if (online.display == true )
1176
+ {
1177
+ oled.clear (PAGE);
1178
+
1179
+ uint8_t fontHeight = 15 ;
1180
+ uint8_t yPos = LCDHEIGHT / 2 - fontHeight;
1181
+
1182
+ printTextCenter (" Accel" , yPos, 1 , 1 , false ); // text, y, font type, kerning, inverted
1183
+ printTextCenter (" Failed" , yPos + fontHeight, 1 , 1 , false ); // text, y, font type, kerning, inverted
1184
+
1185
+ oled.display ();
1186
+
1187
+ delay (displayTime);
1188
+ }
1189
+ }
1190
+
1173
1191
// When user enters serial config menu the display will freeze so show splash while config happens
1174
1192
void displaySerialConfig ()
1175
1193
{
@@ -1458,22 +1476,29 @@ void paintBubbleLevel()
1458
1476
{
1459
1477
if (online.display == true )
1460
1478
{
1461
- forceDisplayUpdate = true ; // Update the display as quickly as possible
1479
+ if (online.accelerometer == true )
1480
+ {
1481
+ forceDisplayUpdate = true ; // Update the display as quickly as possible
1462
1482
1463
- getAngles ();
1483
+ getAngles ();
1464
1484
1465
- // Draw dot in middle
1466
- oled.pixel (LCDWIDTH / 2 , LCDHEIGHT / 2 );
1467
- oled.pixel (LCDWIDTH / 2 + 1 , LCDHEIGHT / 2 );
1468
- oled.pixel (LCDWIDTH / 2 , LCDHEIGHT / 2 + 1 );
1469
- oled.pixel (LCDWIDTH / 2 + 1 , LCDHEIGHT / 2 + 1 );
1485
+ // Draw dot in middle
1486
+ oled.pixel (LCDWIDTH / 2 , LCDHEIGHT / 2 );
1487
+ oled.pixel (LCDWIDTH / 2 + 1 , LCDHEIGHT / 2 );
1488
+ oled.pixel (LCDWIDTH / 2 , LCDHEIGHT / 2 + 1 );
1489
+ oled.pixel (LCDWIDTH / 2 + 1 , LCDHEIGHT / 2 + 1 );
1470
1490
1471
- // Draw circle relative to dot
1472
- const int radiusLarge = 10 ;
1473
- const int radiusSmall = 4 ;
1491
+ // Draw circle relative to dot
1492
+ const int radiusLarge = 10 ;
1493
+ const int radiusSmall = 4 ;
1474
1494
1475
- oled.circle (LCDWIDTH / 2 - averagedPitch, LCDHEIGHT / 2 + averagedRoll, radiusLarge);
1476
- oled.circle (LCDWIDTH / 2 - averagedPitch, LCDHEIGHT / 2 + averagedRoll, radiusSmall);
1495
+ oled.circle (LCDWIDTH / 2 - averagedPitch, LCDHEIGHT / 2 + averagedRoll, radiusLarge);
1496
+ oled.circle (LCDWIDTH / 2 - averagedPitch, LCDHEIGHT / 2 + averagedRoll, radiusSmall);
1497
+ }
1498
+ else
1499
+ {
1500
+ displayAccelFail (0 );
1501
+ }
1477
1502
}
1478
1503
}
1479
1504
0 commit comments