Closed technoblogy closed 10 months ago
With my previous suggestion the trackball sometimes seems to get stuck in the LOW state, in which case Escape is permanently pressed.
This definition of testescape()
seems to be working reliably:
void testescape () {
#if defined serialmonitor
if (Serial.available() && Serial.read() == '~') error2(PSTR("escape!"));
#endif
if (digitalRead(0) == LOW) {
pinMode(0, INPUT_PULLUP);
if (digitalRead(0) == LOW) error2(PSTR("escape!")); // Trackball pushed
}
}
The
tak
benchmark runs much slower than expected. I traced it to the current definition oftestescape()
which is checking for a keypress, and this takes a significant time on the I2C interface.I suggest replacing the definition of
testescape()
with:You can now escape from a running program by pressing in the trackball.
With this change
(tak 18 12 6)
runs in 2.4 s.This will be changed in the next release.