0% found this document useful (0 votes)
20 views34 pages

Bluetooth Technology

Uploaded by

KIMBERLY BOLO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views34 pages

Bluetooth Technology

Uploaded by

KIMBERLY BOLO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 34

ROBOTICS 11

PLAY A GAME
PLAY A GAME

Guess the jumbled word select a


representative and explain the word or
use it in a sentence.
The fastest group who can give the
correct word/s will earn a point.
PLAY A GAME

GAME!!
PLAY A GAME
GROUP 1 GAME!!
RLEWSESSI TOINAINCMMUCO
GROUP 2
TOLOEHUTB DULMOE
GROUP 3
PARNIIG NOICCONNTE
GROUP 4
AATDD ISNMORTAIMS
BLUETOOTH TECHNOLOGY

Learning Objectives:
1. Define Bluetooth Technology
2. Pin outs of Bluetooth Module; and
3. Construct a Circuit Connection with Arduino Code using
Bluetooth Module and Arduino Uno:
What is Bluetooth?
What is Bluetooth?
What is Bluetooth?
What is Bluetooth?
What is Bluetooth?
What is Bluetooth?
What is Bluetooth?
What is Bluetooth?
What is Bluetooth?
Types of Bluetooth Modules
Types of Bluetooth Modules
Components of Bluetooth Module
Pin out of Bluetooth Module
HC - 05 Wiring Diagram with Arduino Uno
HC - 05 Wiring Diagram with Arduino Uno
Sample Code of Bluetooth RC Car using
L293D Motor Driver(Blue)
#include <AFMotor.h>

//initial motors pin


AF_DCMotor motor1(1, MOTOR12_1KHZ);
AF_DCMotor motor2(2, MOTOR12_1KHZ);
AF_DCMotor motor3(3, MOTOR34_1KHZ);
AF_DCMotor motor4(4, MOTOR34_1KHZ);

char command;

void setup()
{
Serial.begin(9600); //Set the baud rate to your Bluetooth
module.
}
Cont..Sample Code of Bluetooth RC Car
using L293D Motor Driver(Blue)
void loop(){
if(Serial.available() > 0){
command = Serial.read();
Stop(); //initialize with motors stoped
//Change pin mode only if new command is different from previous.
//Serial.println(command);
switch(command){
case 'F':
forward();
break;
case 'B':
back();
break;
case 'L':
left();
break;
case 'R':
right();
break;
}
}
}
Cont..Sample Code of Bluetooth RC Car
using L293D Motor Driver(Blue)
void forward()
{
motor1.setSpeed(255); //Define maximum velocity
motor1.run(FORWARD); //rotate the motor clockwise
motor2.setSpeed(255); //Define maximum velocity
motor2.run(FORWARD); //rotate the motor clockwise
motor3.setSpeed(255);//Define maximum velocity
motor3.run(FORWARD); //rotate the motor clockwise
motor4.setSpeed(255);//Define maximum velocity
motor4.run(FORWARD); //rotate the motor clockwise
}

void back()
{
motor1.setSpeed(255); //Define maximum velocity
motor1.run(BACKWARD); //rotate the motor anti-clockwise
motor2.setSpeed(255); //Define maximum velocity
motor2.run(BACKWARD); //rotate the motor anti-clockwise
motor3.setSpeed(255); //Define maximum velocity
motor3.run(BACKWARD); //rotate the motor anti-clockwise
motor4.setSpeed(255); //Define maximum velocity
motor4.run(BACKWARD); //rotate the motor anti-clockwise
}
Cont..Sample Code of Bluetooth RC Car
using L293D Motor Driver(Blue)
void left()
{
motor1.setSpeed(255); //Define maximum velocity
motor1.run(BACKWARD); //rotate the motor anti-clockwise
motor2.setSpeed(255); //Define maximum velocity
motor2.run(BACKWARD); //rotate the motor anti-clockwise
motor3.setSpeed(255); //Define maximum velocity
motor3.run(FORWARD); //rotate the motor clockwise
motor4.setSpeed(255); //Define maximum velocity
motor4.run(FORWARD); //rotate the motor clockwise
}

void right()
{
motor1.setSpeed(255); //Define maximum velocity
motor1.run(FORWARD); //rotate the motor clockwise
motor2.setSpeed(255); //Define maximum velocity
motor2.run(FORWARD); //rotate the motor clockwise
motor3.setSpeed(255); //Define maximum velocity
motor3.run(BACKWARD); //rotate the motor anti-clockwise
motor4.setSpeed(255); //Define maximum velocity
motor4.run(BACKWARD); //rotate the motor anti-clockwise
}
Cont..Sample Code of Bluetooth RC Car
using L293D Motor Driver(Blue)
void Stop()
{
motor1.setSpeed(0); //Define minimum velocity
motor1.run(RELEASE); //stop the motor when release the button
motor2.setSpeed(0); //Define minimum velocity
motor2.run(RELEASE); //rotate the motor clockwise
motor3.setSpeed(0); //Define minimum velocity
motor3.run(RELEASE); //stop the motor when release the button
motor4.setSpeed(0); //Define minimum velocity
motor4.run(RELEASE); //stop the motor when release the button
}
Pin out of Bluetooth Module
Advantages and Disadvantages
THE END.

SEATWORK / ASSIGNMENT
Deadline: April 8, 2024

You might also like