loading
2 Comments

Tell us about yourself!

Complete Your Profile
  • Rover 5 Tank , Arduino Outdoor programming Challenge

    //PLz Follow New Turn#include <AFMotor.h>#include <LiquidCrystal.h>//#include <Servo.h>//Servo myservo;LiquidCrystal lcd(32, 30, 28, 26, 24, 22);AF_DCMotor motor1(1, MOTOR12_8KHZ);AF_DCMotor motor2(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwmAF_DCMotor motor3(3, MOTOR34_64KHZ);AF_DCMotor motor4(4, MOTOR34_1KHZ);int state = 0;int ledLight = 52;int ledRed = 48;int ledGreen = 46;int BodyLight = 53;int LdrPin = A8; // Ldr Sensore pinint LdrValue = 0; // Ldr Sensore pin Value//int pos = 0;int ch1; // RC input pinsint ch2;int ch3;//int ledPin = 13;//const int D1RA = 2;//const int PWMA = 3;const int trigPin = A11; // Sonar Sensore pinsconst int echoPin = A12;const int buttonPin = 50;int buttonPushCounter = 0; // counter for the number of button pressesint buttonState =...see more »//PLz Follow New Turn#include <AFMotor.h>#include <LiquidCrystal.h>//#include <Servo.h>//Servo myservo;LiquidCrystal lcd(32, 30, 28, 26, 24, 22);AF_DCMotor motor1(1, MOTOR12_8KHZ);AF_DCMotor motor2(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwmAF_DCMotor motor3(3, MOTOR34_64KHZ);AF_DCMotor motor4(4, MOTOR34_1KHZ);int state = 0;int ledLight = 52;int ledRed = 48;int ledGreen = 46;int BodyLight = 53;int LdrPin = A8; // Ldr Sensore pinint LdrValue = 0; // Ldr Sensore pin Value//int pos = 0;int ch1; // RC input pinsint ch2;int ch3;//int ledPin = 13;//const int D1RA = 2;//const int PWMA = 3;const int trigPin = A11; // Sonar Sensore pinsconst int echoPin = A12;const int buttonPin = 50;int buttonPushCounter = 0; // counter for the number of button pressesint buttonState = 0; // current state of the buttonint lastButtonState = 0; // previous state of the buttonint sensorpin = A10; int temperature = 0;void setup() { pinMode(buttonPin, INPUT); digitalWrite(buttonPin, HIGH); // myservo.attach(9); pinMode(46, OUTPUT); // Light Green pinMode(48, OUTPUT); // Light Red pinMode(52, OUTPUT); // Light Pin pinMode(53, OUTPUT); // Light Pin pinMode(50, INPUT); //LDR Sensor Pin pinMode(34, INPUT); // RC input pins pinMode(36, INPUT); pinMode(38, INPUT); pinMode(trigPin, OUTPUT); // Sonar Sensore pins pinMode(echoPin, INPUT); pinMode(sensorpin, INPUT); Serial.begin(9600); Serial3.begin(9600); lcd.begin(16, 2);}void LCDdisplay() { lcd.begin(16, 2); lcd.setCursor(4, 0); lcd.print("WELLCOME"); delay(500); lcd.setCursor(3, 0); lcd.print("=WELLCOME="); delay(500); lcd.setCursor(2, 0); lcd.print("-=WELLCOME=-"); delay(1000); lcd.setCursor(3, 1); lcd.print("<ROBOTANK>"); delay(500); lcd.setCursor(2, 1); lcd.print("<<ROBOTANK>>"); delay(500); lcd.setCursor(1, 1); lcd.print("<<<ROBOTANK>>>"); delay(500); lcd.setCursor(0, 1); lcd.print("<<<<ROBOTANK>>>>"); delay(3000); lcd.clear();}void Button() { buttonState = digitalRead(buttonPin); if (buttonState != lastButtonState) { if (buttonState == HIGH) { buttonPushCounter++; Serial.println("on"); Serial.print("number of button pushes: "); Serial.println(buttonPushCounter); } else { Serial.println("off"); } delay(50); } lastButtonState = buttonState; if (buttonPushCounter % 2 == 0) { digitalWrite(ledGreen, HIGH); digitalWrite(ledRed, LOW); } else { digitalWrite(ledRed, HIGH); digitalWrite(ledGreen, LOW); }}float search(void){ float duration = 0.00; float CM = 0.00; digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); // Delay for 10 us digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); CM = (duration / 58.82); //Convert distance into CM. lcd.setCursor(11, 1); lcd.print(CM); float distance = 0.00; distance = search(); if ((distance <= 10)) { RobotLeft(); delay(400); } return CM;}void RightHigh(){ lcd.setCursor(3, 0); lcd.print("sLO"); motor1.setSpeed(250); motor2.setSpeed(250); motor3.setSpeed(100); motor4.setSpeed(100);}void LeftHigh(){ lcd.setCursor(3, 0); lcd.print("sLO"); motor1.setSpeed(100); motor2.setSpeed(100); motor3.setSpeed(250); motor4.setSpeed(250);}void RobotSpeedLow(){ lcd.setCursor(3, 0); lcd.print("sLO"); motor1.setSpeed(150); motor2.setSpeed(150); motor3.setSpeed(150); motor4.setSpeed(150);}void RobotSpeedHigh(){ lcd.setCursor(3, 0); lcd.print("sHi"); motor1.setSpeed(250); motor2.setSpeed(250); motor3.setSpeed(250); motor4.setSpeed(250);}void RobotForward(){ lcd.setCursor(0, 0); lcd.print("BK"); motor1.run(FORWARD); motor2.run(FORWARD); // turn it on going forward motor3.run(FORWARD); motor4.run(FORWARD);}void RobotBackward(){ lcd.setCursor(0, 0); lcd.print("FT"); motor1.run(BACKWARD); motor2.run(BACKWARD); // the other way motor3.run(BACKWARD); motor4.run(BACKWARD);}void RobotLeft(){ lcd.setCursor(0, 1); lcd.print("LF"); motor1.run(BACKWARD); motor2.run(BACKWARD); motor3.run(FORWARD); motor4.run(FORWARD);}void RobotRight(){ lcd.setCursor(0, 1); lcd.print("RT"); motor1.run(FORWARD); motor2.run(FORWARD); motor3.run(BACKWARD); motor4.run(BACKWARD);}void RobotStop(){ motor1.run(RELEASE); motor2.run(RELEASE); motor3.run(RELEASE); motor4.run(RELEASE);}void LdrLight(){ int LdrValue = analogRead(LdrPin); if (LdrValue <= 58) { Serial.println(LdrValue); lcd.setCursor(7, 0); lcd.print("ON*"); digitalWrite(ledLight, HIGH); } else { digitalWrite(ledLight, LOW); lcd.setCursor(7, 0); lcd.print("OFF"); }}void Voltage(){ int VsensorValue = analogRead(A9); float voltage = VsensorValue / 10; lcd.setCursor(11, 0); lcd.print(voltage); lcd.print("V");}void Temper(){ temperature = analogRead(sensorpin); temperature = temperature * 0.48828125; lcd.setCursor(3, 1); lcd.print(temperature); //Show the temperature in LCD lcd.setCursor(5, 1); lcd.print("c"); // C for Celecius}void Speed() { if (ch3 >= 1000) { Serial.println(ch3); RobotSpeedHigh(); } else if (ch3 <= 1000) { Serial.println(ch3); RobotSpeedLow(); }}void Blutooth(){ if (Serial3.available() > 0) { state = Serial3.read(); if (state == 'F' ) { lcd.setCursor(7, 1); lcd.print("B-F"); RobotSpeedHigh(); RobotBackward(); delay(2000); RobotStop(); } else if (state == 'B' ) { lcd.setCursor(7, 1); lcd.print("B-B"); RobotSpeedHigh(); RobotForward(); delay(1000); RobotStop(); } else if (state == 'L' ) { lcd.setCursor(7, 1); lcd.print("B-L"); RobotSpeedHigh(); RobotLeft(); delay(2000); RobotStop(); } else if (state == 'R' ) { lcd.setCursor(7, 1); lcd.print("B-R"); RobotSpeedHigh(); RobotRight(); delay(2000); RobotStop(); } else { lcd.setCursor(7, 1); lcd.print("BLT"); } }}void OldRemote() { ch1 = pulseIn(34, HIGH, 25000); // Read the pulse width of ch2 = pulseIn(36, HIGH, 25000); // each channel ch3 = pulseIn(38, HIGH, 25000); //Serial.println(ch1); // each channel // Serial.println(ch2); // Serial.println(ch3); if (ch2 <= 1300) { RobotForward(); Serial.println(ch2); } else if (ch2 >= 1500) { RobotBackward(); Serial.println(ch2); } else if (ch1 <= 1300) { Serial.println(ch1); RobotLeft(); } else if (ch1 >= 1500) { Serial.println(ch1); RobotRight(); } else if ((ch1 >= 1300) && (ch1 <= 1500) && (ch2 >= 1300) && (ch2 <= 1500)) { RobotStop(); } else { RobotStop(); }}void NewRemote() { int move; // Forward/Back speed int back; // Turning Factor int left; int right; ch1 = pulseIn(34, HIGH, 25000); // Read the pulse width of ch2 = pulseIn(36, HIGH, 25000); // each channel ch3 = pulseIn(38, HIGH, 25000); move = map(ch2, 1000, 2000, -500, 500); //center over zero move = constrain(move, -255, 255); back = map(ch2, 1000, 2000, -500, 500); back = constrain(back, -255, 255); left = map(ch1, 1000, 2000, -500, 500); left = constrain(left, -255, 255); right = map(ch1, 1000, 2000, -500, 500); right = constrain(right, -255, 255); Serial.print("Channel 2:"); // Print the value of Serial.println(right); // each channel //Backward============ if (move >= 15) { motor1.run(BACKWARD); motor2.run(BACKWARD); motor3.run(BACKWARD); motor4.run(BACKWARD); motor1.setSpeed(move); motor2.setSpeed(move); motor3.setSpeed(move); motor4.setSpeed(move); } //Forward============= else if (move <= -15) { back = abs(move); motor1.run(FORWARD); motor2.run(FORWARD); motor3.run(FORWARD); motor4.run(FORWARD); motor1.setSpeed(back); motor2.setSpeed(back); motor3.setSpeed(back); motor4.setSpeed(back); } //Strate Left ============= else if (left >= 15) { //back=abs(move); motor3.run(BACKWARD); motor4.run(BACKWARD); motor3.setSpeed(left); motor4.setSpeed(left); motor1.run(FORWARD); motor2.run(FORWARD); motor1.setSpeed(left); motor2.setSpeed(left); } //Strate Right ============= else if (left <= -15) { right = abs(right); motor3.run(FORWARD); motor4.run(FORWARD); motor3.setSpeed(right); motor4.setSpeed(right); motor1.run(BACKWARD); motor2.run(BACKWARD); motor1.setSpeed(right); motor2.setSpeed(right); } else { motor1.run(RELEASE); motor2.run(RELEASE); motor3.run(RELEASE); motor4.run(RELEASE); }}void NewTurn () { int move; // Forward/Back speed int back; // Turning Factor int left; int right; ch1 = pulseIn(34, HIGH, 25000); // Read the pulse width of ch2 = pulseIn(36, HIGH, 25000); // each channel ch3 = pulseIn(38, HIGH, 25000); move = map(ch2, 1000, 2000, -500, 500); //center over zero move = constrain(move, -255, 255); back = map(ch2, 1000, 2000, -500, 500); back = constrain(back, -255, 255); left = map(ch1, 1000, 2000, -500, 500); left = constrain(left, -255, 255); right = map(ch1, 1000, 2000, -500, 500); right = constrain(right, -255, 255); Serial.print("Channel 2:"); // Print the value of Serial.println(left); // each channelif ((move<= -40) && (left <= -40))// Back Left High{ LeftHigh(); motor1.run(FORWARD); motor2.run(FORWARD); motor3.run(FORWARD); motor4.run(FORWARD);}else if ((move<= -40) && (left >= 40))// Back Right High{ RightHigh(); motor1.run(FORWARD); motor2.run(FORWARD); motor3.run(FORWARD); motor4.run(FORWARD);}else if ((move>= 40) && (left >= 40))// Front Left High mean Right Turn{ LeftHigh(); motor1.run(BACKWARD); motor2.run(BACKWARD); motor3.run(BACKWARD); motor4.run(BACKWARD);}else if ((move>= 40) && (left <= -40))// Front Rihgt High mean Left Turn{ RightHigh(); motor1.run(BACKWARD); motor2.run(BACKWARD); motor3.run(BACKWARD); motor4.run(BACKWARD);} else { motor1.run(RELEASE); motor2.run(RELEASE); motor3.run(RELEASE); motor4.run(RELEASE); }}void Run(){ Temper(); Voltage(); LdrLight(); Blutooth(); Speed(); Button();}void loop() {NewTurn ();}

    #include <AFMotor.h>#include <LiquidCrystal.h>//#include <Servo.h>//Servo myservo;LiquidCrystal lcd(32, 30, 28, 26, 24, 22);AF_DCMotor motor1(1, MOTOR12_8KHZ);AF_DCMotor motor2(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwmAF_DCMotor motor3(3, MOTOR34_64KHZ);AF_DCMotor motor4(4, MOTOR34_1KHZ);int state = 0;int ledLight = 52;int ledRed = 48;int ledGreen = 46;int BodyLight = 53;int LdrPin = A8; // Ldr Sensore pinint LdrValue = 0; // Ldr Sensore pin Value//int pos = 0;int ch1; // RC input pinsint ch2;int ch3;//int ledPin = 13;//const int D1RA = 2;//const int PWMA = 3;const int trigPin = A11; // Sonar Sensore pinsconst int echoPin = A12;const int buttonPin = 50;int buttonPushCounter = 0; // counter for the number of button pressesint buttonState = 0; // curren...see more »#include <AFMotor.h>#include <LiquidCrystal.h>//#include <Servo.h>//Servo myservo;LiquidCrystal lcd(32, 30, 28, 26, 24, 22);AF_DCMotor motor1(1, MOTOR12_8KHZ);AF_DCMotor motor2(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwmAF_DCMotor motor3(3, MOTOR34_64KHZ);AF_DCMotor motor4(4, MOTOR34_1KHZ);int state = 0;int ledLight = 52;int ledRed = 48;int ledGreen = 46;int BodyLight = 53;int LdrPin = A8; // Ldr Sensore pinint LdrValue = 0; // Ldr Sensore pin Value//int pos = 0;int ch1; // RC input pinsint ch2;int ch3;//int ledPin = 13;//const int D1RA = 2;//const int PWMA = 3;const int trigPin = A11; // Sonar Sensore pinsconst int echoPin = A12;const int buttonPin = 50;int buttonPushCounter = 0; // counter for the number of button pressesint buttonState = 0; // current state of the buttonint lastButtonState = 0; // previous state of the buttonint sensorpin = A10; int temperature = 0;void setup() { pinMode(buttonPin, INPUT); digitalWrite(buttonPin, HIGH); // myservo.attach(9); pinMode(46, OUTPUT); // Light Green pinMode(48, OUTPUT); // Light Red pinMode(52, OUTPUT); // Light Pin pinMode(53, OUTPUT); // Light Pin pinMode(50, INPUT); //LDR Sensor Pin pinMode(34, INPUT); // RC input pins pinMode(36, INPUT); pinMode(38, INPUT); pinMode(trigPin, OUTPUT); // Sonar Sensore pins pinMode(echoPin, INPUT); pinMode(sensorpin, INPUT); Serial.begin(9600); Serial3.begin(9600); lcd.begin(16, 2);}void LCDdisplay() { lcd.begin(16, 2); lcd.setCursor(4, 0); lcd.print("WELLCOME"); delay(500); lcd.setCursor(3, 0); lcd.print("=WELLCOME="); delay(500); lcd.setCursor(2, 0); lcd.print("-=WELLCOME=-"); delay(1000); lcd.setCursor(3, 1); lcd.print("<ROBOTANK>"); delay(500); lcd.setCursor(2, 1); lcd.print("<<ROBOTANK>>"); delay(500); lcd.setCursor(1, 1); lcd.print("<<<ROBOTANK>>>"); delay(500); lcd.setCursor(0, 1); lcd.print("<<<<ROBOTANK>>>>"); delay(3000); lcd.clear();}void Button() { buttonState = digitalRead(buttonPin); if (buttonState != lastButtonState) { if (buttonState == HIGH) { buttonPushCounter++; Serial.println("on"); Serial.print("number of button pushes: "); Serial.println(buttonPushCounter); } else { Serial.println("off"); } delay(50); } lastButtonState = buttonState; if (buttonPushCounter % 2 == 0) { digitalWrite(ledGreen, HIGH); digitalWrite(ledRed, LOW); } else { digitalWrite(ledRed, HIGH); digitalWrite(ledGreen, LOW); }}float search(void){ float duration = 0.00; float CM = 0.00; digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); // Delay for 10 us digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); CM = (duration / 58.82); //Convert distance into CM. lcd.setCursor(11, 1); lcd.print(CM); float distance = 0.00; distance = search(); if ((distance <= 10)) { RobotLeft(); delay(400); } return CM;}void RightHigh(){ lcd.setCursor(3, 0); lcd.print("sLO"); motor1.setSpeed(250); motor2.setSpeed(250); motor3.setSpeed(100); motor4.setSpeed(100);}void LeftHigh(){ lcd.setCursor(3, 0); lcd.print("sLO"); motor1.setSpeed(100); motor2.setSpeed(100); motor3.setSpeed(250); motor4.setSpeed(250);}void RobotSpeedLow(){ lcd.setCursor(3, 0); lcd.print("sLO"); motor1.setSpeed(150); motor2.setSpeed(150); motor3.setSpeed(150); motor4.setSpeed(150);}void RobotSpeedHigh(){ lcd.setCursor(3, 0); lcd.print("sHi"); motor1.setSpeed(250); motor2.setSpeed(250); motor3.setSpeed(250); motor4.setSpeed(250);}void RobotForward(){ lcd.setCursor(0, 0); lcd.print("BK"); motor1.run(FORWARD); motor2.run(FORWARD); // turn it on going forward motor3.run(FORWARD); motor4.run(FORWARD);}void RobotBackward(){ lcd.setCursor(0, 0); lcd.print("FT"); motor1.run(BACKWARD); motor2.run(BACKWARD); // the other way motor3.run(BACKWARD); motor4.run(BACKWARD);}void RobotLeft(){ lcd.setCursor(0, 1); lcd.print("LF"); motor1.run(BACKWARD); motor2.run(BACKWARD); motor3.run(FORWARD); motor4.run(FORWARD);}void RobotRight(){ lcd.setCursor(0, 1); lcd.print("RT"); motor1.run(FORWARD); motor2.run(FORWARD); motor3.run(BACKWARD); motor4.run(BACKWARD);}void RobotStop(){ motor1.run(RELEASE); motor2.run(RELEASE); motor3.run(RELEASE); motor4.run(RELEASE);}void LdrLight(){ int LdrValue = analogRead(LdrPin); if (LdrValue <= 58) { Serial.println(LdrValue); lcd.setCursor(7, 0); lcd.print("ON*"); digitalWrite(ledLight, HIGH); } else { digitalWrite(ledLight, LOW); lcd.setCursor(7, 0); lcd.print("OFF"); }}void Voltage(){ int VsensorValue = analogRead(A9); float voltage = VsensorValue / 10; lcd.setCursor(11, 0); lcd.print(voltage); lcd.print("V");}void Temper(){ temperature = analogRead(sensorpin); temperature = temperature * 0.48828125; lcd.setCursor(3, 1); lcd.print(temperature); //Show the temperature in LCD lcd.setCursor(5, 1); lcd.print("c"); // C for Celecius}void Speed() { if (ch3 >= 1000) { Serial.println(ch3); RobotSpeedHigh(); } else if (ch3 <= 1000) { Serial.println(ch3); RobotSpeedLow(); }}void Blutooth(){ if (Serial3.available() > 0) { state = Serial3.read(); if (state == 'F' ) { lcd.setCursor(7, 1); lcd.print("B-F"); RobotSpeedHigh(); RobotBackward(); delay(2000); RobotStop(); } else if (state == 'B' ) { lcd.setCursor(7, 1); lcd.print("B-B"); RobotSpeedHigh(); RobotForward(); delay(1000); RobotStop(); } else if (state == 'L' ) { lcd.setCursor(7, 1); lcd.print("B-L"); RobotSpeedHigh(); RobotLeft(); delay(2000); RobotStop(); } else if (state == 'R' ) { lcd.setCursor(7, 1); lcd.print("B-R"); RobotSpeedHigh(); RobotRight(); delay(2000); RobotStop(); } else { lcd.setCursor(7, 1); lcd.print("BLT"); } }}void OldRemote() { ch1 = pulseIn(34, HIGH, 25000); // Read the pulse width of ch2 = pulseIn(36, HIGH, 25000); // each channel ch3 = pulseIn(38, HIGH, 25000); //Serial.println(ch1); // each channel // Serial.println(ch2); // Serial.println(ch3); if (ch2 <= 1300) { RobotForward(); Serial.println(ch2); } else if (ch2 >= 1500) { RobotBackward(); Serial.println(ch2); } else if (ch1 <= 1300) { Serial.println(ch1); RobotLeft(); } else if (ch1 >= 1500) { Serial.println(ch1); RobotRight(); } else if ((ch1 >= 1300) && (ch1 <= 1500) && (ch2 >= 1300) && (ch2 <= 1500)) { RobotStop(); } else { RobotStop(); }}void NewRemote() { int move; // Forward/Back speed int back; // Turning Factor int left; int right; ch1 = pulseIn(34, HIGH, 25000); // Read the pulse width of ch2 = pulseIn(36, HIGH, 25000); // each channel ch3 = pulseIn(38, HIGH, 25000); move = map(ch2, 1000, 2000, -500, 500); //center over zero move = constrain(move, -255, 255); back = map(ch2, 1000, 2000, -500, 500); back = constrain(back, -255, 255); left = map(ch1, 1000, 2000, -500, 500); left = constrain(left, -255, 255); right = map(ch1, 1000, 2000, -500, 500); right = constrain(right, -255, 255); Serial.print("Channel 2:"); // Print the value of Serial.println(right); // each channel //Backward============ if (move >= 15) { motor1.run(BACKWARD); motor2.run(BACKWARD); motor3.run(BACKWARD); motor4.run(BACKWARD); motor1.setSpeed(move); motor2.setSpeed(move); motor3.setSpeed(move); motor4.setSpeed(move); } //Forward============= else if (move <= -15) { back = abs(move); motor1.run(FORWARD); motor2.run(FORWARD); motor3.run(FORWARD); motor4.run(FORWARD); motor1.setSpeed(back); motor2.setSpeed(back); motor3.setSpeed(back); motor4.setSpeed(back); } //Strate Left ============= else if (left >= 15) { //back=abs(move); motor3.run(BACKWARD); motor4.run(BACKWARD); motor3.setSpeed(left); motor4.setSpeed(left); motor1.run(FORWARD); motor2.run(FORWARD); motor1.setSpeed(left); motor2.setSpeed(left); } //Strate Right ============= else if (left <= -15) { right = abs(right); motor3.run(FORWARD); motor4.run(FORWARD); motor3.setSpeed(right); motor4.setSpeed(right); motor1.run(BACKWARD); motor2.run(BACKWARD); motor1.setSpeed(right); motor2.setSpeed(right); } else { motor1.run(RELEASE); motor2.run(RELEASE); motor3.run(RELEASE); motor4.run(RELEASE); }}void NewTurn () { int move; // Forward/Back speed int back; // Turning Factor int left; int right; ch1 = pulseIn(34, HIGH, 25000); // Read the pulse width of ch2 = pulseIn(36, HIGH, 25000); // each channel ch3 = pulseIn(38, HIGH, 25000); move = map(ch2, 1000, 2000, -500, 500); //center over zero move = constrain(move, -255, 255); back = map(ch2, 1000, 2000, -500, 500); back = constrain(back, -255, 255); left = map(ch1, 1000, 2000, -500, 500); left = constrain(left, -255, 255); right = map(ch1, 1000, 2000, -500, 500); right = constrain(right, -255, 255); Serial.print("Channel 2:"); // Print the value of Serial.println(left); // each channelif ((move<= -40) && (left <= -40))// Back Left High{ LeftHigh(); motor1.run(FORWARD); motor2.run(FORWARD); motor3.run(FORWARD); motor4.run(FORWARD);}else if ((move<= -40) && (left >= 40))// Back Right High{ RightHigh(); motor1.run(FORWARD); motor2.run(FORWARD); motor3.run(FORWARD); motor4.run(FORWARD);}else if ((move>= 40) && (left >= 40))// Front Left High mean Right Turn{ LeftHigh(); motor1.run(BACKWARD); motor2.run(BACKWARD); motor3.run(BACKWARD); motor4.run(BACKWARD);}else if ((move>= 40) && (left <= -40))// Front Rihgt High mean Left Turn{ RightHigh(); motor1.run(BACKWARD); motor2.run(BACKWARD); motor3.run(BACKWARD); motor4.run(BACKWARD);} else { motor1.run(RELEASE); motor2.run(RELEASE); motor3.run(RELEASE); motor4.run(RELEASE); }}void Run(){ Temper(); Voltage(); LdrLight(); Blutooth(); Speed(); Button();}void loop() {NewRemote(); //digitalWrite(53, HIGH);//NewTurn ();}

    View Instructable »