Skip to content

Commit

Permalink
Merge pull request #107 from sio-funmatsu/fix-faces-examples
Browse files Browse the repository at this point in the history
fix faces examples
  • Loading branch information
EeeeBin authored Nov 20, 2018
2 parents a2c6b5c + 8385ccd commit 682f3dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/Modules/FACES/I2C_Keyboard/I2C_Keyboard.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void loop()
while (Wire.available()) {
uint8_t key_val = Wire.read(); // receive a byte as character
if(key_val != 0) {
if(key_val > 20 && key_val < 0x7F) { // ASCII String
if(key_val > 0x20 && key_val < 0x7F) { // ASCII String
Serial.print((char)key_val);
M5.Lcd.print((char)key_val);
} else {
Expand All @@ -29,4 +29,4 @@ void loop()
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ void loop() {
uint8_t key_val;
// xQueueReceive(keyboard_queue, &key_val, portMAX_DELAY) // block
if(xQueueReceive(keyboard_queue, &key_val, 0)) { // Non-blocking
if(key_val > 20 && key_val < 0x7F) { // ASCII String
if(key_val > 0x20 && key_val < 0x7F) { // ASCII String
Serial.print((char)key_val);
M5.Lcd.print((char)key_val);
} else {
Serial.printf("0x%02X ",key_val);
M5.Lcd.printf("0x%02X ",key_val);
}
}
}
}

0 comments on commit 682f3dd

Please sign in to comment.