Automobilität in Arduino. Erfinder: Rorory
#include <Motor.h>
int LED_rot= 3;
int motor_L1 = 5;
int motor_L2 = 6;
int motor_R1 = 10;
int motor_R2 = 11;
const int TrigPin = 11;
const int EchoPin = 12;
float cm;
void setup (){
pinMode(TrigPin, OUTPUT);
pinMode(EchoPin, INPUT);
Serial.begin(9600);
pinMode (LED_rot,OUTPUT);
pinMode(motor_R1, OUTPUT);
pinMode(motor_R2, OUTPUT);
pinMode(motor_L1, OUTPUT);
pinMode(motor_L2, OUTPUT);
}
void loop (){
delay(5000);
digitalWrite(LED_rot,HIGH);
digitalWrite(motor_L1, 100) ;
digitalWrite(motor_R1, 255) ;
delay(10000);
digitalWrite(motor_L1, LOW) ;
digitalWrite(motor_R1, LOW) ;
delay(10000);
}
#include <Motor.h>
int LED_rot= 3;
int motor_L1 = 5;
int motor_L2 = 6;
int motor_R1 = 10;
int motor_R2 = 11;
const int TrigPin = 11;
const int EchoPin = 12;
float cm;
void setup (){
pinMode(TrigPin, OUTPUT);
pinMode(EchoPin, INPUT);
Serial.begin(9600);
pinMode (LED_rot,OUTPUT);
pinMode(motor_R1, OUTPUT);
pinMode(motor_R2, OUTPUT);
pinMode(motor_L1, OUTPUT);
pinMode(motor_L2, OUTPUT);
}
void loop (){
delay(5000);
digitalWrite(LED_rot,HIGH);
digitalWrite(motor_L1, 100) ;
digitalWrite(motor_R1, 255) ;
delay(10000);
digitalWrite(motor_L1, LOW) ;
digitalWrite(motor_R1, LOW) ;
delay(10000);
}
#include <Motor.h>
int LED_rot= 3;
int motor_L1 = 5;
int motor_L2 = 6;
int motor_R1 = 10;
int motor_R2 = 11;
const int TrigPin = 11;
const int EchoPin = 12;
float cm;
void setup (){
pinMode(TrigPin, OUTPUT);
pinMode(EchoPin, INPUT);
Serial.begin(9600);
pinMode (LED_rot,OUTPUT);
pinMode(motor_R1, OUTPUT);
pinMode(motor_R2, OUTPUT);
pinMode(motor_L1, OUTPUT);
pinMode(motor_L2, OUTPUT);
}
void loop (){
delay(5000);
digitalWrite(LED_rot,HIGH);
digitalWrite(motor_L1, 100) ;
digitalWrite(motor_R1, 255) ;
delay(10000);
digitalWrite(motor_L1, LOW) ;
digitalWrite(motor_R1, LOW) ;
delay(10000);
}
#include <Motor.h>
int LED_rot= 3;
int motor_L1 = 5;
int motor_L2 = 6;
int motor_R1 = 10;
int motor_R2 = 11;
const int TrigPin = 11;
const int EchoPin = 12;
float cm;
void setup (){
pinMode(TrigPin, OUTPUT);
pinMode(EchoPin, INPUT);
Serial.begin(9600);
pinMode (LED_rot,OUTPUT);
pinMode(motor_R1, OUTPUT);
pinMode(motor_R2, OUTPUT);
pinMode(motor_L1, OUTPUT);
pinMode(motor_L2, OUTPUT);
}
void loop (){
delay(5000);
digitalWrite(LED_rot,HIGH);
digitalWrite(motor_L1, 100) ;
digitalWrite(motor_R1, 255) ;
delay(10000);
digitalWrite(motor_L1, LOW) ;
digitalWrite(motor_R1, LOW) ;
delay(10000);
}
#include <Motor.h>
int LED_rot= 3;
int motor_L1 = 5;
int motor_L2 = 6;
int motor_R1 = 10;
int motor_R2 = 11;
const int TrigPin = 11;
const int EchoPin = 12;
float cm;
void setup (){
pinMode(TrigPin, OUTPUT);
pinMode(EchoPin, INPUT);
Serial.begin(9600);
pinMode (LED_rot,OUTPUT);
pinMode(motor_R1, OUTPUT);
pinMode(motor_R2, OUTPUT);
pinMode(motor_L1, OUTPUT);
pinMode(motor_L2, OUTPUT);
}
void loop (){
delay(5000);
digitalWrite(LED_rot,HIGH);
digitalWrite(motor_L1, 100) ;
digitalWrite(motor_R1, 255) ;
delay(10000);
digitalWrite(motor_L1, LOW) ;
digitalWrite(motor_R1, LOW) ;
delay(10000);
}
#include <Motor.h>
int LED_rot= 3;
int motor_L1 = 5;
int motor_L2 = 6;
int motor_R1 = 10;
int motor_R2 = 11;
const int TrigPin = 11;
const int EchoPin = 12;
float cm;
void setup (){
pinMode(TrigPin, OUTPUT);
pinMode(EchoPin, INPUT);
Serial.begin(9600);
pinMode (LED_rot,OUTPUT);
pinMode(motor_R1, OUTPUT);
pinMode(motor_R2, OUTPUT);
pinMode(motor_L1, OUTPUT);
pinMode(motor_L2, OUTPUT);
}
void loop (){
delay(5000);
digitalWrite(LED_rot,HIGH);
digitalWrite(motor_L1, 100) ;
digitalWrite(motor_R1, 255) ;
delay(10000);
digitalWrite(motor_L1, LOW) ;
digitalWrite(motor_R1, LOW) ;
delay(10000);
}
Version wird noch überarbeitet.
Henry, Robin, Romain