Here is a simple program which will wave our servo arm:
This code will move the servo motor to 70 degrees, wait a second (which is 1000 milliseconds), move the servo motor to 135 degrees, wait another second, then repeat forever. This should result in a waving motion.
Adding Sound and Light Easily - The Final Code
MakeCode can play musical notes or preset short sounds. Below, a cute sound has been added when Adabot's arm waves.
The on start
block sets the Circuit Playground lights to light blue as a background for Adabot's head. The forever
loop waves Adabot's arm via the servo until power is removed.
And here is the MakeCode Robot in action: