int MotorHold = 12; // motor connected Arduino boards on 12 no. pin.int MotorLeave = 13; // motor connected Arduino boards on 13 no. pin.void setup(){
pinMode(MotorHold, OUTPUT); // initialize the pin as an output.
pinMode(MotorLeave, OUTPUT); // initialize the pin as an output.
}
void loop()
{
digitalWrite(MotorHold, HIGH); // turn the pin 12 ON
digitalWrite(MotorLeave, LOW); // turn the pin 13 OFF
delay(6000); // wait for 6 seconds ( 1000millisecond = 1 second )
digitalWrite(MotorHold, LOW); // turn the pin 12 OFF
digitalWrite(MotorLeave, HIGH); // turn the pin 13 ON
delay(6000); // wait for 6 seconds ( 1000millisecond = 1 second )
}
No comments:
Post a Comment