diff --git a/mozc-mageru/README.md b/mozc-mageru/README.md index 675b76b..74ad84c 100644 --- a/mozc-mageru/README.md +++ b/mozc-mageru/README.md @@ -54,13 +54,15 @@ We have tried it with PLA, but it will probably work with ABS as well. ## Sensor calibration 1. Open Serial Monitor. -2. (the home position, which decides when to commit a character) +2. Send '!' once to disable key output. +3. (the home position, which decides when to commit a character) Bend the sensor slightly and send '0'. Make sure the LED turns off when the spoon is not bent by external force. -3. (the position for the first letter) +4. (the position for the first letter) Bend the sensor slightly a bit more and send '1'. -4. (the position for the last letter) +5. (the position for the last letter) Bend the sensor to the end and send '2'. -5. Send 'w' to save the configuration to EEPROM. +6. Send 'w' to save the configuration to EEPROM. +7. Send '!' again to enable key output, or reset the device. # Wireless Version diff --git a/mozc-mageru/wired/firmware/firmware.ino b/mozc-mageru/wired/firmware/firmware.ino index 0b8ec15..0c252b9 100644 --- a/mozc-mageru/wired/firmware/firmware.ino +++ b/mozc-mageru/wired/firmware/firmware.ino @@ -77,16 +77,12 @@ void LoadDefaultConfig() { void setup() { Serial.begin(115200); + Keyboard.begin(); LoadConfig(); pinMode(kLedPin, OUTPUT); digitalWrite(kLedPin, LOW); } -void SetupKeyboard() { - enable_key_output = true; - Keyboard.begin(); -} - void OutputKey(const char* str) { if (!enable_key_output) { Serial.print(str); @@ -152,7 +148,7 @@ void loop() { // Other debug commands. case '!': - SetupKeyboard(); + enable_key_output = !enable_key_output; break; case ' ': // Show sensor status for debugging.