Example Code for micro:bit-Basic Control

This tutorial will demonstrate how to make this peristaltic pump clockwise rotation, stop rotation, counterclockwise rotation of these three basic functions.

Hardware Preparation

Software Preparation

https://makecode.microbit.org/

Wiring Diagram

Peristaltic Pump micro_bit Wiring Diagram

Sample Code

Peristaltic Pump  Example Code for micro_bit

Result

After uploading the sample code, you can see that the peristaltic pump starts to work and continuously switches between the three states of clockwise maximum speed rotation, stop and maximum counterclockwise rotation speed every 2 seconds.

Was this article helpful?

TOP