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
- DFR0523 Gravity: Digital Peristaltic Pump (SKU:DFR0523 x 1)
- External Power(5~7V) x1
- micro:bit (SKU:MBT0039 x 1)
- Essential Sensor IO Extender for micro:bit(SKU:MBT0008 x 1)Or other extender boards
Software Preparation
https://makecode.microbit.org/
Wiring Diagram

Sample Code

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?
