Processing-like framework for Pebble Smartwatch. Let's sketch a watchface with code!
int cl = WHITE;
void setup() {
noLoop();
}
void draw() {
fill(cl);
rect(25, 25, 50, 50);
}
void keyPressed() {
}
void keyReleased() {
if (cl == WHITE) {
cl = BLACK;
} else {
cl = WHITE;
}
redraw();
}
The keyReleased() function is called when a key is released. The key that was released will be stored in the keyCode variable. See keyCode for more information. If you use this function, you have to define "ENABLE_KEY_EVENT" at settings.h and declare also keyPressed() at sketch.c.
keyReleased()
void
keyCode
keyPressed()