1. Single ranging
Ranging is performed only once after the API function is called. System returns to SW standby automatically.
2. Continuous ranging
Ranging is performed in a continuous way after the API function is called. As soon as the measurement is finished, another one is started without delay. User has to stop the ranging to return to SW standby. The last measurement is completed before stopping.
// Uncomment ONE of these two lines to get
// - higher speed at the cost of lower accuracy OR
// - higher accuracy at the cost of lower speed
//#define HIGH_SPEED
//#define HIGH_ACCURACY
最大3145728バイトのフラッシュメモリのうち、スケッチが2100679バイト(66%)を使っています。
最大327680バイトのRAMのうち、グローバル変数が53552バイト(16%)を使っていて、ローカル変数で274128バイト使うことができます。
esptool.py v2.6
Serial port COM6
Connecting.......
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: ****
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 624.2 kbit/s)...
Hash of data verified.
Compressed 17392 bytes to 11186...
Writing at 0x00001000... (100 %)
Wrote 17392 bytes (11186 compressed) at 0x00001000 in 0.2 seconds (effective 565.6 kbit/s)...
Hash of data verified.
Compressed 2100800 bytes to 1661765...
Writing at 0x00010000... (0 %)
Writing at 0x00014000... (1 %)
…
Writing at 0x001a0000... (99 %)
Writing at 0x001a4000... (100 %)
Wrote 2100800 bytes (1661765 compressed) at 0x00010000 in 32.8 seconds (effective 512.8 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 119...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (119 compressed) at 0x00008000 in 0.1 seconds (effective 225.5 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
void basicMotion(char c) {
String s = String(c);
mySerial.println(s);
if (s == "8") {
forward();
} else if (s == "2") {
reverse();
} else if (s == "7") {
turnLeft();
} else if (s == "9") {
turnRight();
} else if (s == "4") {
rotateLeft();
} else if (s == "6") {
rotateRight();
} else if (s == "5") {
brake();
}
}