Being able to turn things is pretty useful. Robots for example have lot of motors in them.
There are a few different types of motor. Each work in a slight different way and are suited to different tasks, the two types we'll be looking at today are:
- DC motors - When current is supplied to the motor it will continue to turn until power is removed. Quite hard to make precise amounts of turn.
- Stepper motors - They work by switching current to a number of separate coils in the right sequence allowing rotation in set “steps” motor can turn a set amount.
As motors need quite a bit of power they can't be powered directly from the Adruino pins. Some extra electronics are required to avoid damaging the Arduino. These are usually based around transistors, that act as electronic switches. To save time we'll be using pre-build shields but this could be wired up directly.
Motor Shield
https://learn.adafruit.com/adafruit-motor-shield/use-it
There are several different types of motor and servo supported by this shield. With helpers assistance you should be able to experiment with a few of these.
Small Stepper Motor with Driver
There is some example code on http://www.4tronix.co.uk/arduino/Stepper-Motors.php