|
@@ -21,14 +21,14 @@ OSC configuration custom page
|
|
|
#include <FS.h>
|
|
|
#include <SPIFFS.h>
|
|
|
#include <M5Stack.h>
|
|
|
+
|
|
|
+extern void lcd_sleep();
|
|
|
+extern void lcd_wakeup();
|
|
|
+
|
|
|
#include "wifimgr.h"
|
|
|
#include "oscmgr.h"
|
|
|
#include "imu.h"
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
|
|
|
int sensor_rate = 10;
|
|
@@ -36,6 +36,20 @@ long int last_sent;
|
|
|
|
|
|
|
|
|
|
|
|
+long int idle ;
|
|
|
+long int idle_offset;
|
|
|
+
|
|
|
+void lcd_sleep(){
|
|
|
+ M5.Lcd.sleep();
|
|
|
+ M5.Lcd.setBrightness(0);
|
|
|
+}
|
|
|
+
|
|
|
+void lcd_wakeup(){
|
|
|
+ M5.Lcd.wakeup();
|
|
|
+ M5.Lcd.setBrightness(200);
|
|
|
+ idle_offset=millis();
|
|
|
+}
|
|
|
+
|
|
|
void drawNetworkInfo(int offsetX, int offsetY){
|
|
|
|
|
|
String printString = "Connected to ";
|
|
@@ -83,7 +97,6 @@ void drawSensorInfo(int offsetX, int offsetY){
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
void setup() {
|
|
@@ -162,28 +175,25 @@ void setup() {
|
|
|
|
|
|
|
|
|
|
|
|
-long int idle ;
|
|
|
-long int idle_offset;
|
|
|
+
|
|
|
|
|
|
void loop() {
|
|
|
|
|
|
idle = millis()-idle_offset;
|
|
|
if(idle>60000){
|
|
|
- M5.Lcd.sleep();
|
|
|
- M5.Lcd.setBrightness(0);
|
|
|
+ lcd_sleep();
|
|
|
}
|
|
|
|
|
|
if(M5.BtnA.read()){
|
|
|
- M5.Lcd.wakeup();
|
|
|
- M5.Lcd.setBrightness(200);
|
|
|
- idle_offset=millis();
|
|
|
+ lcd_wakeup();
|
|
|
}
|
|
|
|
|
|
|
|
|
if (calib_flag)
|
|
|
{
|
|
|
- calib_flag = false;
|
|
|
- calibGyro();
|
|
|
+ lcd_wakeup();
|
|
|
+ calib_flag = false;
|
|
|
+ calibGyro();
|
|
|
}
|
|
|
handle_imu();
|
|
|
|