Commit 2f0a6a47 by satsob

nRF Robot

parent ac4e4521
...@@ -19,7 +19,7 @@ BTLE btle(&radio); // Create BTLE object to work with the BTLE library. ...@@ -19,7 +19,7 @@ BTLE btle(&radio); // Create BTLE object to work with the BTLE library.
/* Replace! "CustomName" to the name of your device. Password - maximum length (14)! characters. /* Replace! "CustomName" to the name of your device. Password - maximum length (14)! characters.
It's for recognizing the correct data packets. */ It's for recognizing the correct data packets. */
#define PASSWORD "CustomName" #define PASSWORD "Galaxy A70"
/* Define functions used for the robot to control */ /* Define functions used for the robot to control */
/* Stop the robot */ /* Stop the robot */
...@@ -58,7 +58,7 @@ void setup() { ...@@ -58,7 +58,7 @@ void setup() {
leftWheel.attach(leftServo); leftWheel.attach(leftServo);
/* Put servos to standstill */ /* Put servos to standstill */
//setWheels(); //setWheelsStop();
} }
void loop() { void loop() {
...@@ -92,21 +92,22 @@ void loop() { ...@@ -92,21 +92,22 @@ void loop() {
delay(100); delay(100);
} }
else if ((char (str.charAt(2))) == 5) { else if ((char (str.charAt(2))) == 5) {
Serial.println("FORWARD"); Serial.println("BACKWARD");
setWheelsForward(); setWheelsBackward();
delay(100); delay(100);
} }
else if ((char (str.charAt(2))) == 4) { else if ((char (str.charAt(2))) == 4) {
Serial.println("BACKWARD"); Serial.println("FORWARD");
setWheelsBackward(); setWheelsForward();
delay(100); delay(100);
} }
}
else { else {
Serial.println("STOP");
setWheelsStop(); setWheelsStop();
delay(100); delay(100);
} }
} }
}
/* Hop channels through 37-39 to scan for data transmissions */ /* Hop channels through 37-39 to scan for data transmissions */
btle.hopChannel(); btle.hopChannel();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment