Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
satsob
/
Robotite_ylesannete_projekt
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2f0a6a47
authored
Oct 05, 2020
by
satsob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nRF Robot
parent
ac4e4521
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
nRF_BTLE_ReceiveData/nRF_RobotControl/nRF_RobotControl.ino
nRF_BTLE_ReceiveData/nRF_RobotControl/nRF_RobotControl.ino
View file @
2f0a6a47
...
@@ -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();
//setWheels
Stop
();
}
}
void
loop
()
{
void
loop
()
{
...
@@ -92,20 +92,21 @@ void loop() {
...
@@ -92,20 +92,21 @@ void loop() {
delay
(
100
);
delay
(
100
);
}
}
else
if
((
char
(
str
.
charAt
(
2
)))
==
5
)
{
else
if
((
char
(
str
.
charAt
(
2
)))
==
5
)
{
Serial
.
println
(
"
FOR
WARD"
);
Serial
.
println
(
"
BACK
WARD"
);
setWheels
For
ward
();
setWheels
Back
ward
();
delay
(
100
);
delay
(
100
);
}
}
else
if
((
char
(
str
.
charAt
(
2
)))
==
4
)
{
else
if
((
char
(
str
.
charAt
(
2
)))
==
4
)
{
Serial
.
println
(
"
BACK
WARD"
);
Serial
.
println
(
"
FOR
WARD"
);
setWheels
Back
ward
();
setWheels
For
ward
();
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 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment