KAKKAR KEVIN
AF_DCMotor motor1(1, MOTOR12_64KHZ); // create motor #1, 64KHz pwm
AF_DCMotor motor2(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwm
int sensor = 10;
void setup() {
motor1.setSpeed(150);
motor2.setSpeed(150);
pinMode(sensor, INPUT);
}
void loop() {
if(digitalRead(sensor) == LOW){
motor1.run(RELEASE);
motor2.run(RELEASE);
}
else{
motor1.run(FORWARD);
motor2.run(FORWARD);
}
}
Erstellt: Kevin Kakkar (06.03.2014)
Letzte Änderung: Kevin Kakkar (06.03.2014)