/* **************************************************** Conveyor Belt - LabVIEW **************************************************** The conveyor belt moves 5 min to the right, then 5 min to the left, then stops for 5 min and so on. Pinout: Right: IN1=1 -> OUT1= 12V IN2=0 -> OUT2= GND Left: IN1=1 -> OUT1= GND IN2=0 -> OUT2= 12V **************************************************** Alberto E. Cohaila B. - FabAcademy 2022 **************************************************** */ int PinIN1 = 2; int PinIN2 = 3; int time = 5000; void setup() { Serial.begin(9600); pinMode(PinIN1, OUTPUT); pinMode(PinIN2, OUTPUT); } void loop() { EngineRight(); Serial.println("Clockwise Motor Rotation"); delay(time); EngineLeft(); Serial.println("Rotate the motor counterclockwise"); delay(time); EngineStop(); Serial.println("Engine Stopped"); delay(time); } void EngineRight() { digitalWrite (PinIN1, HIGH); digitalWrite (PinIN2, LOW); } void EngineLeft() { digitalWrite (PinIN1, LOW); digitalWrite (PinIN2, HIGH); } void EngineStop() { digitalWrite (PinIN1, LOW); digitalWrite (PinIN2, LOW); }