不再需要诱导

This commit is contained in:
unlockable
2023-09-10 13:44:55 +08:00
parent f0d7ac873e
commit df4e264dba

View File

@@ -20,7 +20,7 @@
#define MAG_UPDATE 0x08 #define MAG_UPDATE 0x08
#define READ_UPDATE 0x80 #define READ_UPDATE 0x80
#define DEBUG true #define DEBUG false
#define TRACE false #define TRACE false
// 3 width, 4 height // 3 width, 4 height
@@ -166,6 +166,11 @@ public:
} }
} }
if (WitSetBandwidth(BANDWIDTH_256HZ) != WIT_HAL_OK) {
Serial.println("Set Bandwidth Error");
return false;
}
if (WitSetContent(RSW_ANGLE | RSW_ACC | RSW_GYRO) != WIT_HAL_OK) { if (WitSetContent(RSW_ANGLE | RSW_ACC | RSW_GYRO) != WIT_HAL_OK) {
Serial.println("Set send content: angle, acc, and GYRO Error"); Serial.println("Set send content: angle, acc, and GYRO Error");
return false; return false;
@@ -1220,7 +1225,8 @@ void words() {
} }
else { else {
Serial.print(display_string[next_char_ptr]); Serial.print(display_string[next_char_ptr]);
Cube::draw_letter(0, 7, 7, display_string[next_char_ptr] - '0' + 26, 2, 3); Cube::draw_letter(0, 7, 7, display_string[next_char_ptr] - '0' + 26, 2,
3);
} }
next_char_ptr++; next_char_ptr++;
@@ -1303,8 +1309,8 @@ void calculate_and_draw() {
if (SensorReader::angle.z - z_ref > 40.0) { if (SensorReader::angle.z - z_ref > 40.0) {
if (DEBUG) { if (DEBUG) {
Serial.println(SensorReader::angle.z); Serial.println(SensorReader::angle.z);
Serial.println("e");
} }
Serial.println("Zoom out");
zoom /= 2.0; zoom /= 2.0;
need_reevaluate = true; need_reevaluate = true;
waiting_for_command = false; waiting_for_command = false;
@@ -1312,8 +1318,8 @@ void calculate_and_draw() {
else if (SensorReader::angle.z - z_ref < -40.0) { else if (SensorReader::angle.z - z_ref < -40.0) {
if (DEBUG) { if (DEBUG) {
Serial.println(SensorReader::angle.z); Serial.println(SensorReader::angle.z);
Serial.println("f");
} }
Serial.println("Zoom in");
zoom *= 2.0; zoom *= 2.0;
need_reevaluate = true; need_reevaluate = true;
waiting_for_command = false; waiting_for_command = false;