Mr. Grimm SLOHS
Pages
Home
Mission Statement
Healthy Self Podcast
Whiteboard
Tuesday, September 12, 2017
Arduino Blink plus Motor
//This is the basic blink program, plus a few changes. int ledPin = 13; // LED connected to digital pin 13 int motorPin = 12; // motor pin connected to pin 12 void setup() // run once, when the sketch starts { pinMode(ledPin, OUTPUT); // sets pin 13 as output pinMode(motorPin, OUTPUT); // sets pin 12 as output } void loop() // run over and over again { digitalWrite(ledPin, HIGH); // sets the LED on delay(5000); // waits for five seconds digitalWrite(ledPin, LOW); // sets the LED off delay(1); // waits for 1 thousandth of a second digitalWrite(motorPin, HIGH); // sets motor pin on delay(5000); // waits for 5 seconds digitalWrite(motorPin, LOW); // sets motor pin off }
Go to Tools--> Port and choose the COM with Arduino
Click the arrow to upload the sketch
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment