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.

Be sure you use the green Servo blocks under the CRICKIT group and NOT the red Servo blocks under the PINS block group!

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:

This guide was first published on Jul 13, 2018. It was last updated on Jul 13, 2018.

This page (Using MakeCode) was last updated on Nov 06, 2020.