Add the following snippet to your HTML:
A DC motor control for Arduino Uno.
Read up about this project on
I changed a motor tutorial to work with my board.
int m = 5; void setup() { pinMode(m, OUTPUT); Serial.begin(9600); while (! Serial); } void loop() { if (Serial.available()) { int speed = Serial.parseInt(); if (speed >= 0 && speed <= 255) { analogWrite(m, speed); } } }
Comments