Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8141736

Browse files
Fixed condition in keypress handler
1 parent a0a645e commit 8141736

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/base-line-follower.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ board.on("ready", function () {
4747
console.log("Press the spacebar to end calibration and start running...");
4848

4949
stdin.on("keypress", function(chunk, key) {
50-
if (key && key.name !== 'space') return;
50+
if (!key || key.name !== 'space') return;
5151

5252
calibrating = false;
5353
running = !running;

0 commit comments

Comments
 (0)