Simulator
The reset function works only on a real Calliope mini and not in the simulator.
Reset the Calliope mini and start the program again.
This function is like pressing the reset button on the back of the Calliope mini.
control.reset()
This program will count as high as you like when you press button A
.
When you get tired of counting, press button B
to reset the
Calliope mini and start the program over.
let item = 0;
basic.showNumber(item);
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Down), () => {
item = item + 1;
basic.showNumber(item);
});
input.onButtonEvent(Button.B, input.buttonEventValue(ButtonEvent.Down), () => {
control.reset();
});