void setup() { // initialize the digital pins as outputs. // Pin 13 has a LED connected on most Arduino boards: pinMode(13, OUTPUT); pinMode(7, OUTPUT);//Motor connected on pin 7 en 8, these are PWM capable pinMode(8, OUTPUT); } void loop() { digitalWrite(7, HIGH); //start motor at full speed digitalWrite(8, LOW); digitalWrite(13, HIGH); //turn on LED delay(5000);//wait digitalWrite(7, LOW); //stop motor digitalWrite(8, LOW); delay(1000); //wait a second to be sure motor is stopped digitalWrite(7, LOW); //start motor in reverse direction, full speed digitalWrite(8, HIGH); digitalWrite(13, LOW); //turn off led delay(5000);//wacht digitalWrite(7, LOW); //stop motor digitalWrite(8, LOW); delay(1000); //wait a second to be sure motor is stopped }
Info: I'm given a task by my professor. My job is to modify this code to make both motors to funtion at the same period of time such as : Going forward, Going backward/Reverse. Can somebody help me ? Below is the link for circuit diagram ( Link: http://people.mech.kuleuven.be/~dvanthienen/soiree_pratique/HackerManual.pdf)