www.keyestudio.com
① The "on start" command block runs only once to
start the program.
②Set the initial value of the angle variable to 0.
③ In the "forever" command box, the program runs
cyclically
④Cycle 180 times
⑤Rotate the servo to angle
⑥ Angle variable increases 1
⑦ Delay in 10ms
⑧ Cycle 180 times
⑨The servo rotates to angle
⑩Angle angle variable minus 1
⑪ Delay in 10ms
Click"JavaScript" to view the corresponding JavaScript code: :
245