Getting Started Guide

CLASS 4
24
Time Watch Coding Activities
Time Watch
Was it hard to make the last program? Now, we will divide it into a parts and work through it.
First, you need to make the variable increase by 1 for every second. Refer to the code below!
The code on the left adds “1” to the variable every
second. Now, the variable you have made works as a
timer! If you remember what we’ve learned previously,
you know that you can replace the value of servo motor
angle with the value that can be expressed as a number.
Replace the “counter” variable with the value of the
servo motor angle.
Don’t forget to do infinite repeat!
Combine these codes
1 second
2 second