some basic code for the Elecfreaks Cutebot and the HC-SR04 distance sensor
https://makecode.microbit.org/
https://www.elecfreaks.com/micro-bit-smart-cutebot.html
and they have a wiki with example projects
https://www.elecfreaks.com/learn-en/microbitKit/smart_cutebot/index.html