Examples
var pb = new Pushbutton(PORT_3A);
while(true) {
if (pb.clicked()) print("Button clicked");
}
API
Pushbutton(int port3);
on(); // returns true if button is pressed
off(); // returns true if button is not pressed
clicked(); // returns true if button has been pressed and released since the last call
Note that clicked()
returns true
once if at least one button click has been detected since the last call. Subsequent calls to clicked()
will return false
unless another button click is detected.