TINKER PIEDESIGN IN INDIA

Button counter

Use a variable to count button presses. Beginner · 10 min

Start this tutorial in TinkerPie Studio

  1. Make a variable

    Open Variables and press Create variable…. Call it count.

  2. Start at zero

    Put set count to 0 inside on start.

  3. React to button A

    From Input, drag on button A pressed onto the workspace. Inside it put change count by 1.

  4. Show the number

    Add show number under it and drop the round count block into its slot.

  5. Test in the simulator

    Press Run, then click button A on the board picture (or press the A key). The number goes up.

  6. Add a reset

    Add on button B pressed with set count to 0. Now B starts again from zero.