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
9072634c
authored
Jan 13, 2021
by
satsob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Uuendused
parent
9a17b0e3
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
215 additions
and
0 deletions
Lõputöö ülesanded/nRF_Stuff/README.md → Lõputöö ülesanded/1. BLE ühenduse loomine RF24 ja nutitelefoni vahel/nRF_Stuff/README.md
Lõputöö ülesanded/nRF_Stuff/nRF_Receive_Send/README.md → Lõputöö ülesanded/1. BLE ühenduse loomine RF24 ja nutitelefoni vahel/nRF_Stuff/nRF_Receive_Send/README.md
Lõputöö ülesanded/nRF_Stuff/nRF_Receive_Send/nRF_BTLE_ReceiveData/nRF_BTLE_ReceiveData.ino → Lõputöö ülesanded/1. BLE ühenduse loomine RF24 ja nutitelefoni vahel/nRF_Stuff/nRF_Receive_Send/nRF_BTLE_ReceiveData/nRF_BTLE_ReceiveData.ino
Lõputöö ülesanded/nRF_Stuff/nRF_Receive_Send/nRF_BTLE_SendData/nRF_BTLE_SendData.ino → Lõputöö ülesanded/1. BLE ühenduse loomine RF24 ja nutitelefoni vahel/nRF_Stuff/nRF_Receive_Send/nRF_BTLE_SendData/nRF_BTLE_SendData.ino
Lõputöö ülesanded/nRF_Stuff/nRF_RobotControl/nRF_RobotControl.ino → Lõputöö ülesanded/1. BLE ühenduse loomine RF24 ja nutitelefoni vahel/nRF_Stuff/nRF_RobotControl/nRF_RobotControl.ino
Lõputöö ülesanded/Joystick_Receiver_Slave/Joystick_Receiver_Slave.ino → Lõputöö ülesanded/2. Roboti puldiga juhtimise ülesanne/Joystick_Receiver_Slave/Joystick_Receiver_Slave.ino
Lõputöö ülesanded/Joystick_Sender/Joystick_Sender.ino → Lõputöö ülesanded/2. Roboti puldiga juhtimise ülesanne/Joystick_Sender/Joystick_Sender.ino
Lõputöö ülesanded/3. Roboti juhtimine BT ühenduse kaudu/Projket_Bluetooth/Projket_Bluetooth.ino
Lõputöö ülesanded/Ultrasonic_Sensor_Tasks/.gitkeep → Lõputöö ülesanded/4. Labürindi läbimine liigutatava ultraheli sensoriga/Ultrasonic_Sensor_Tasks/.gitkeep
Lõputöö ülesanded/Ultrasonic_Sensor_Tasks/README.md → Lõputöö ülesanded/4. Labürindi läbimine liigutatava ultraheli sensoriga/Ultrasonic_Sensor_Tasks/README.md
Lõputöö ülesanded/Ultrasonic_Sensor_Tasks/Robot_Car_Test1_-_UltraSonicSensor.ino → Lõputöö ülesanded/4. Labürindi läbimine liigutatava ultraheli sensoriga/Ultrasonic_Sensor_Tasks/Robot_Car_Test1_-_UltraSonicSensor.ino
Lõputöö ülesanded/LCD_Draw_Robot_Steps/LCD_16x2_b2.ino → Lõputöö ülesanded/5. Raja kaardistamine ekraanile/LCD_Draw_Robot_Steps/LCD_16x2_b2.ino
Lõputöö ülesanded/nRF_Stuff/README.md
→
Lõputöö ülesanded/
1. BLE ühenduse loomine RF24 ja nutitelefoni vahel/
nRF_Stuff/README.md
View file @
9072634c
File moved
Lõputöö ülesanded/nRF_Stuff/nRF_Receive_Send/README.md
→
Lõputöö ülesanded/
1. BLE ühenduse loomine RF24 ja nutitelefoni vahel/
nRF_Stuff/nRF_Receive_Send/README.md
View file @
9072634c
File moved
Lõputöö ülesanded/nRF_Stuff/nRF_Receive_Send/nRF_BTLE_ReceiveData/nRF_BTLE_ReceiveData.ino
→
Lõputöö ülesanded/
1. BLE ühenduse loomine RF24 ja nutitelefoni vahel/
nRF_Stuff/nRF_Receive_Send/nRF_BTLE_ReceiveData/nRF_BTLE_ReceiveData.ino
View file @
9072634c
File moved
Lõputöö ülesanded/nRF_Stuff/nRF_Receive_Send/nRF_BTLE_SendData/nRF_BTLE_SendData.ino
→
Lõputöö ülesanded/
1. BLE ühenduse loomine RF24 ja nutitelefoni vahel/
nRF_Stuff/nRF_Receive_Send/nRF_BTLE_SendData/nRF_BTLE_SendData.ino
View file @
9072634c
File moved
Lõputöö ülesanded/nRF_Stuff/nRF_RobotControl/nRF_RobotControl.ino
→
Lõputöö ülesanded/
1. BLE ühenduse loomine RF24 ja nutitelefoni vahel/
nRF_Stuff/nRF_RobotControl/nRF_RobotControl.ino
View file @
9072634c
File moved
Lõputöö ülesanded/Joystick_Receiver_Slave/Joystick_Receiver_Slave.ino
→
Lõputöö ülesanded/
2. Roboti puldiga juhtimise ülesanne/
Joystick_Receiver_Slave/Joystick_Receiver_Slave.ino
View file @
9072634c
File moved
Lõputöö ülesanded/Joystick_Sender/Joystick_Sender.ino
→
Lõputöö ülesanded/
2. Roboti puldiga juhtimise ülesanne/
Joystick_Sender/Joystick_Sender.ino
View file @
9072634c
File moved
Lõputöö ülesanded/3. Roboti juhtimine BT ühenduse kaudu/Projket_Bluetooth/Projket_Bluetooth.ino
0 → 100644
View file @
9072634c
#include <SoftwareSerial.h>
#include <SoftwareSerial.h>
//#include <SPI.h>
//Blue RXD - TXD - 3
//Green TXD - RXD - 2
SoftwareSerial
BTserial
(
2
,
3
);
// RX | TX
char
receivedBluetValue
;
int
motorValue
=
0
;
int
d7
=
5
;
//43; // Yellow, front wheel 2 - Forward
int
d2
=
6
;
//41; // Red, front wheel 2 - Backward
int
d8
=
7
;
//47; // Green, back wheel 2 - Forward
int
d1
=
8
;
//45; // Orange, back wheel 2 - Backward
int
d6
=
9
;
//40; // White, front wheel 1 - Backward
int
d5
=
10
;
//42; // Black, front wheel 1 - Forward
int
d4
=
11
;
//44; // Grey, back wheel 1 - Backward
int
d3
=
12
;
//46; // Dark Greenish, back wheel 1 - Forward
//int speedN1 = ;
//int speedS1 = ;
//int speedN2 = ;
//int speedS2 = ;
void
setup
()
{
Serial
.
begin
(
9600
);
// Default communication rate of the Bluetooth module
// HC-05 default serial speed for AT mode is 38400. 9600 works here!
BTserial
.
begin
(
9600
);
//Serial.println("AT+PAIR=A0CB,FD,DDE2F9,20");
//Declaring the pin modes
pinMode
(
d7
,
OUTPUT
);
// Yellow
pinMode
(
d2
,
OUTPUT
);
// Red
pinMode
(
d8
,
OUTPUT
);
// Green
pinMode
(
d1
,
OUTPUT
);
// Orange
pinMode
(
d3
,
OUTPUT
);
// Dark Greenish
pinMode
(
d4
,
OUTPUT
);
// Grey
pinMode
(
d5
,
OUTPUT
);
// Black
pinMode
(
d6
,
OUTPUT
);
// White
//pinMode(speedN, OUTPUT);
//pinMode(speedS, OUTPUT);
}
void
loop
()
{
//Serial.println("AT+PAIR=A0CB,FD,DDE2F9,20"); //To pair Bluetooth device with an address
//of A0:CB:FD:DD:E2:F9). 20 is the connection time limit.
// Keep reading from HC-05 and send to Arduino Serial Monitor
if
(
BTserial
.
available
())
{
receivedBluetValue
=
BTserial
.
read
();
Serial
.
write
(
receivedBluetValue
);
//Serial.println(receivedBluetValue);
//Serial.println("ON");
}
//else
// Serial.println("OFF");
// Keep reading from Arduino Serial Monitor and send to HC-05
if
(
Serial
.
available
())
{
receivedBluetValue
=
Serial
.
read
();
//Serial.println(receivedBluetValue);
BTserial
.
write
(
receivedBluetValue
);
}
//motorValue'd on suured tähed ASCII kümnendkoodis.
//Näiteks "Forward" on F ehk 70 10nd süsteemis.
motorValue
=
receivedBluetValue
;
//Serial.println(motorValue);
if
(
motorValue
==
70
){
Forward
();
delay
(
100
);
Serial
.
println
(
"Forward"
);}
else
if
(
motorValue
==
66
){
Backward
();
delay
(
100
);
Serial
.
println
(
"Backward"
);}
else
if
(
motorValue
==
82
){
Right
();
delay
(
100
);
Serial
.
println
(
"Right"
);}
else
if
(
motorValue
==
76
){
Left
();
delay
(
100
);
Serial
.
println
(
"Left"
);}
else
if
(
motorValue
==
73
){
ForwardRight
();
delay
(
100
);
Serial
.
println
(
"ForwardRight"
);}
else
if
(
motorValue
==
71
){
ForwardLeft
();
delay
(
100
);
Serial
.
println
(
"ForwardLeft"
);}
else
if
(
motorValue
==
74
){
BackwardRight
();
delay
(
100
);
Serial
.
println
(
"BackwardRight"
);}
else
if
(
motorValue
==
72
){
BackwardLeft
();
delay
(
100
);
Serial
.
println
(
"BackwardLeft"
);}
else
{
Stop
();
delay
(
100
);
motorValue
=
0
;
}
}
void
Forward
()
{
digitalWrite
(
d8
,
LOW
);
digitalWrite
(
d1
,
HIGH
);
//analogWrite(speedS,150);
digitalWrite
(
d7
,
LOW
);
digitalWrite
(
d2
,
HIGH
);
//analogWrite(speedN,150);
digitalWrite
(
d3
,
LOW
);
digitalWrite
(
d4
,
HIGH
);
digitalWrite
(
d5
,
LOW
);
digitalWrite
(
d6
,
HIGH
);
}
void
Backward
()
{
digitalWrite
(
d8
,
HIGH
);
digitalWrite
(
d1
,
LOW
);
//analogWrite(speedS,150);
digitalWrite
(
d7
,
HIGH
);
digitalWrite
(
d2
,
LOW
);
//analogWrite(speedN,150);
digitalWrite
(
d3
,
HIGH
);
digitalWrite
(
d4
,
LOW
);
digitalWrite
(
d5
,
HIGH
);
digitalWrite
(
d6
,
LOW
);
}
void
Right
()
{
digitalWrite
(
d8
,
LOW
);
digitalWrite
(
d1
,
LOW
);
//analogWrite(speedS,150);
digitalWrite
(
d7
,
LOW
);
digitalWrite
(
d2
,
LOW
);
//analogWrite(speedN,150);
digitalWrite
(
d3
,
LOW
);
digitalWrite
(
d4
,
HIGH
);
digitalWrite
(
d5
,
LOW
);
digitalWrite
(
d6
,
HIGH
);
}
void
Left
()
{
digitalWrite
(
d8
,
LOW
);
digitalWrite
(
d1
,
HIGH
);
//analogWrite(speedS,150);
digitalWrite
(
d7
,
LOW
);
digitalWrite
(
d2
,
HIGH
);
//analogWrite(speedN,150);
digitalWrite
(
d3
,
LOW
);
digitalWrite
(
d4
,
LOW
);
digitalWrite
(
d5
,
LOW
);
digitalWrite
(
d6
,
LOW
);
}
void
ForwardRight
()
{
digitalWrite
(
d8
,
LOW
);
digitalWrite
(
d1
,
HIGH
);
digitalWrite
(
d7
,
LOW
);
digitalWrite
(
d2
,
LOW
);
digitalWrite
(
d3
,
LOW
);
digitalWrite
(
d4
,
HIGH
);
digitalWrite
(
d5
,
LOW
);
digitalWrite
(
d6
,
HIGH
);
}
void
ForwardLeft
()
{
digitalWrite
(
d8
,
LOW
);
digitalWrite
(
d1
,
LOW
);
digitalWrite
(
d7
,
LOW
);
digitalWrite
(
d2
,
HIGH
);
digitalWrite
(
d3
,
LOW
);
digitalWrite
(
d4
,
HIGH
);
digitalWrite
(
d5
,
LOW
);
digitalWrite
(
d6
,
HIGH
);
}
void
BackwardRight
()
{
digitalWrite
(
d8
,
HIGH
);
digitalWrite
(
d1
,
LOW
);
digitalWrite
(
d7
,
LOW
);
digitalWrite
(
d2
,
LOW
);
digitalWrite
(
d3
,
HIGH
);
digitalWrite
(
d4
,
LOW
);
digitalWrite
(
d5
,
HIGH
);
digitalWrite
(
d6
,
LOW
);
}
void
BackwardLeft
()
{
digitalWrite
(
d8
,
LOW
);
digitalWrite
(
d1
,
LOW
);
digitalWrite
(
d7
,
HIGH
);
digitalWrite
(
d2
,
LOW
);
digitalWrite
(
d3
,
HIGH
);
digitalWrite
(
d4
,
LOW
);
digitalWrite
(
d5
,
HIGH
);
digitalWrite
(
d6
,
LOW
);
}
void
Stop
()
{
digitalWrite
(
d8
,
LOW
);
digitalWrite
(
d1
,
LOW
);
//analogWrite(speedS,0);
digitalWrite
(
d7
,
LOW
);
digitalWrite
(
d2
,
LOW
);
//analogWrite(speedN,0);
digitalWrite
(
d3
,
LOW
);
digitalWrite
(
d4
,
LOW
);
digitalWrite
(
d5
,
LOW
);
digitalWrite
(
d6
,
LOW
);
}
Lõputöö ülesanded/Ultrasonic_Sensor_Tasks/.gitkeep
→
Lõputöö ülesanded/
4. Labürindi läbimine liigutatava ultraheli sensoriga/
Ultrasonic_Sensor_Tasks/.gitkeep
View file @
9072634c
File moved
Lõputöö ülesanded/Ultrasonic_Sensor_Tasks/README.md
→
Lõputöö ülesanded/
4. Labürindi läbimine liigutatava ultraheli sensoriga/
Ultrasonic_Sensor_Tasks/README.md
View file @
9072634c
File moved
Lõputöö ülesanded/Ultrasonic_Sensor_Tasks/Robot_Car_Test1_-_UltraSonicSensor.ino
→
Lõputöö ülesanded/
4. Labürindi läbimine liigutatava ultraheli sensoriga/
Ultrasonic_Sensor_Tasks/Robot_Car_Test1_-_UltraSonicSensor.ino
View file @
9072634c
File moved
Lõputöö ülesanded/LCD_Draw_Robot_Steps/LCD_16x2_b2.ino
→
Lõputöö ülesanded/
5. Raja kaardistamine ekraanile/
LCD_Draw_Robot_Steps/LCD_16x2_b2.ino
View file @
9072634c
File moved
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