Sie sind auf Seite 1von 2

/*

3 LED AND DC MOTOR FOR ARDUINO

*/

// the setup function runs once when you press reset or power the board

int motorpin1 = 0;

int motorpin2 = 1;

void setup()

// initialize digital pins as output

pinMode(13, OUTPUT); // for RED LED

pinMode(12, OUTPUT); // for BLUE LED

pinMode(8, OUTPUT); // for GREEN LED

pinMode(motorpin1, OUTPUT); // MOTOR PIN 1

pinMode(motorpin2, OUTPUT); // MOTOR PIN 2

// the loop function runs over and over again forever

void loop()

digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)

delay(1000); // wait for a second

digitalWrite(12, HIGH);

delay(1000);
digitalWrite(8, HIGH);

delay(1000);

digitalWrite(0, HIGH); // MOTOR CLOCKWISE

digitalWrite(1, LOW); // MOTOR CLOCKWISE

delay(1000);

digitalWrite(0, LOW); // MOTOR ANTI-CLOCKWISE

digitalWrite(1, HIGH); // MOTOR ANTI-CLOCKWISE