EasyManua.ls Logo

Freenove ESP32 - Page 146

Default Icon
159 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Need support? support@freenove.com
144
Chapter 15 Dog
www.freenove.com █
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
if (!cs.isCameraNormal) {
setMelodyToQueue(MELODY_CAM_FAILURE);
}
setMelodyToQueue(MELODY_POWER_UP);
standUp();
}
void loop() {
task_CommandService(NULL);
task_BleUploadService(NULL);
task_showBuiltInLed(NULL);
vTaskDelay(20);
static uint32_t lastT = 0;
if (millis() - lastT > 1000) {
// Serial.printf("Total heap: %d\r\n", ESP.getHeapSize());
// Serial.printf("Free heap: %d\r\n", ESP.getFreeHeap());
lastT = millis();
}
}
void loopSecondary(void *pvParameters) {
while (1) {
task_BatteryPowerListener(NULL);
task_showRGBLeds(NULL);
task_AutoWalking(NULL);
task_BuzzerService(NULL);
task_TouchPad(NULL);
vTaskDelay(50);
}
vTaskDelete(xTaskGetCurrentTaskHandle());
}
void serialEventRun() {
static String serialInputString = "";
while (Serial.available()) {
char inChar = (char)Serial.read();
serialInputString += inChar;
if (inChar == '\n') {
enterMessageQueue(serialInputString);
serialInputString = "";
}
}
}

Related product manuals