#include <Servo.h> 
Servo right_motor,left_motor;  // create servo object to control a servo 
 
void setup() 
{ 
  right_motor.attach(11);  // Attaches the servo on pin 11 
  left_motor.attach(12);  // Attaches the servo on pin 12
} 
 
void loop() 
{ 
 
  // Compare it with reference
  if (digitalRead(10)==0) { // If TRUE
     left_motor.write(0);  // Reverse one motor
     delay(750); // Wait until turn is enough
   }
    right_motor.write(0);    // Drive forward
    left_motor.write(180);   // Drive forward
 
} 
mektory.txt · Last modified: 2020/07/20 09:00 by 127.0.0.1
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0