control a DC motor

control a DC motor

Physical computing - Master the challenges and experience how to connect the physical and virtual world

Medium

30 mins

from 10 years on

1What you need
- DC motor - potentiometer - battery - 7 wires
2Challenge
####Connect a potentiometer and a DC motor to the Calliope mini. The speed of the motor is controlled by the potentiometer.
3Solution
###Code

Note: The Calliope mini motor driver is required to control motors. An additional power supply with up to 9V can also be connected there.

Motor control

If only one motor (A) is connected, it can be run forwards and backwards. (Values from -100 to 100)
If two motors (A, B) are connected, they can only turn in one direction. (Values from 0 to 100)

Wiring of the motor pins

This text as well as the image is published under a CC BY-SA 4.0 DE license popup: yes. It was originally published in German popup: yes by phzh popup: yes and translated into English by the Calliope team.