Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ============Drive===========
- = Made By: Nicholas McCurry=
- = Free public use =
- */
- //This is the pin the circut is pluged in
- int reverse = 13;
- void setup() {
- // initialize the digital pin as an output.
- pinMode(reverse, OUTPUT);
- }
- void loop() {
- digitalWrite(reverse, HIGH); //Reverses motor direction
- delay(3000); //How long to go this direction
- digitalWrite(reverse, LOW); //Sets it back to normal direction
- delay(500); //How long to go this direction
- /*Change i < 10 to change how long it stays still */
- for(int i = 0; i < 10; i++){
- //This is ment to go forward and back really quick
- //mimicing the robot stoping
- digitalWrite(reverse, LOW);
- delay(30);
- digitalWrite(reverse, HIGH);
- delay(30);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement