SHARE
TWEET

Untitled

a guest Jan 26th, 2020 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int motorPin=3;
  2. void setup() {
  3.   pinMode(motorPin, OUTPUT);
  4.   Serial.begin (9600);
  5.   while (! Serial);
  6.   Serial.println("Speed 0 to 10");
  7.  
  8. }
  9.  
  10. void loop()
  11. {
  12.  
  13.   if (Serial.available ())
  14.   {
  15.   int speed= Serial.parseInt();
  16.   if (speed >= 0 && speed <= 250)
  17.   {
  18.   analogWrite(motorPin, speed);
  19.   }
  20.   }
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top