Hackster is hosting Hackster Holidays, Ep. 4: Livestream & Giveaway Drawing. Start streaming on Wednesday!Stream Hackster Holidays, Ep. 4 on Wednesday!

Bluetooth Controlled Robot

Control your robot using an Android app to perform various tasks in difficult environmental conditions.

IntermediateFull instructions provided24 hours1,474
Bluetooth Controlled Robot

Things used in this project

Story

Read more

Schematics

bluetooth robot

Circuit for interfacing bluetooth and motor driver with MSP430 Launchpad

Code

bluetooth robot

Arduino
code for controlling the motion of a robot using MSP430G2 launchpad
char temp;
void setup()
{
  // put your setup code here, to run once:
  // confgure port pins as o/p
  //pins 11, 12, 13 and 14 are used for L293D motor driver
  pinMode(11,OUTPUT);
  pinMode(12,OUTPUT);
  pinMode(13,OUTPUT);
  pinMode(14,OUTPUT);
  // initial state of all the pins is LOW
  digitalWrite(11,LOW);
  digitalWrite(12,LOW);
  digitalWrite(13,LOW);
  digitalWrite(14,LOW);
  // initialize Serial communication
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly: 

  while(!Serial.available()); // wait for serial data
  if(Serial.available()>0) // execute when serial data is received
  {
    temp=Serial.read(); // read the serial data byte and store in temp variable
    if(temp=='A') // check if received data is 'A'
    {
      // move forward
      digitalWrite(11,HIGH);
      digitalWrite(12,LOW);
      digitalWrite(13,LOW);
      digitalWrite(14,HIGH);
    }
    if(temp=='B')
    {
      //move backward
      digitalWrite(11,LOW);
      digitalWrite(12,HIGH);
      digitalWrite(13,HIGH);
      digitalWrite(14,LOW);

    }

    if(temp=='C')
    {
      
      //move left
      digitalWrite(11,HIGH);
      digitalWrite(12,LOW);
      digitalWrite(13,LOW);
      digitalWrite(14,LOW);

    }
    
    if(temp=='D')
    {
      //move right
      digitalWrite(11,LOW);
      digitalWrite(12,LOW);
      digitalWrite(13,LOW);
      digitalWrite(14,HIGH);
      
    }
    
    if(temp=='E')
    {
      //stop robot
      digitalWrite(11,LOW);
      digitalWrite(12,LOW);
      digitalWrite(13,LOW);
      digitalWrite(14,LOW);
    }
  }
}

Credits

Dr. Umesh Dutta

Dr. Umesh Dutta

42 projects • 60 followers
Working as Director of Innovation Centre at Manav Rachna, India. I am into development for the last 12 years.
Texas Instruments University Program

Texas Instruments University Program

91 projects • 120 followers
TI helps students discover what's possible to engineer their future.
Energia

Energia

34 projects • 26 followers
Founder of @energiaproject

Comments