Skip to content

Commit

Permalink
Update important_arduino_project/important_arduino_project.ino
Browse files Browse the repository at this point in the history
  • Loading branch information
niksaoul committed Oct 18, 2018
1 parent 5b464f8 commit 9c6b50c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions important_arduino_project/important_arduino_project.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
int photoresistorSmall = A0; // Photoresistor of the small breadboard
int photoresistorBig = A1; // Photoresistor of the big breadboard
int photoresistorSmall = A2; // Photoresistor of the small breadboard
int photoresistorBig = A3; // Photoresistor of the big breadboard
int valueSmall = 0;
int valueBig = 0;
int i=0;
Expand Down Expand Up @@ -89,14 +89,14 @@ void loop() {

if(pid_sum > 0){

pid_sum = map(pid_sum,0, 40,70, 255);
pid_sum = map(pid_sum,0, 50,30, 255);
analogWrite(enablePin, pid_sum); //Control speed
digitalWrite(motorRight, HIGH); //Control Direction
digitalWrite(motorLeft, LOW);

}else if(pid_sum < 0){

pid_sum = map(-pid_sum,0, 40,70, 255);
pid_sum = map(-pid_sum,0, 50,30, 255);
analogWrite(enablePin, pid_sum);
digitalWrite(motorRight, LOW);
digitalWrite(motorLeft, HIGH);
Expand Down

0 comments on commit 9c6b50c

Please sign in to comment.