Sunday, October 21, 2018

Day 16 10/18/18

Arduino Homework

1.    Modify your code so that the potentiometer controls the motor speed.


//Simple Motor Speed Control Program
const int MOTOR=9; //Motor on Digital Pin 9
int POT = A0;
void setup()
{
 pinMode (MOTOR, OUTPUT);
}
void loop()
{

 analogWrite(MOTOR, analogRead(POT));
 }

No comments:

Post a Comment