Instructions for Pupils
Open mBlock and design a program to control a DC motor. You will use a potentiometer and learn how to control a motor with mBlock and the Arduino.
Use a loop to repeat your code over and over again:
// connect the potentiometer to analog 0 (A0) and read the value
// set "pwm pin 9 output" (0-255) to the value of analog 0 (A0; 0-1023)
// use an operator to adjust the analog read value (0-1023) to the pwm output (0-255)
// control the motor speed with the potentiometer
1. Tap the button.
2. Tap the
tool to record the Arduino experiment setup.
3. Explain what your program does while the experiment is running..
4. Tap the
button to add to your portfolio.