- This topic has 1 reply, 2 voices, and was last updated 5 years, 6 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
|
Miscellaneous › Others › Bluetooth controlled Robot using MATLAB
I was working on a project in which I want to control a avr based Bot using a MATLAB based application via a bluetooth connection. I succesfully made the application to connect with the bot using a bluetooth module (HC-05). The problem rises is with sending commands to the robot in order to make that move in various directions. I am using Atmega8 in the Bot.
Here is the code-
AVR code-
UCSRA=0x00;
UCSRB=0x18;
UCSRC=0x86;
UBRRH=0x00;
UBRRL=0x0C;
ACSR=0x80;
SFIOR=0x00;
DDRB=0xFF;
while(1)
{
char data;
while(!(UCSRA & (1<
data=UDR;
if (Data==’F’)
{
PORTB=0b00001010;
}
else if (Data==’B’)
{
PORTB=0b00000101;
}
}
}
MATLAB Code-
instrhwinfo(‘Bluetooth’,’HC-05′)
b = Bluetooth(‘HC-05’,1)
fopen(b)
fprintf(b, ‘F’) %– on execution of first command button
fprintf(b, ‘B’) %– on execution of second command butoon
you can get help from this project https://www.engineersgarage.com/contribution/controlling-wireless-robot-matlab-gui