0

In Arduino Uno, com12 board, already Bluetooth code is installed or not?

I am doing the project based on robot using Arduino.

I uploaded already one code, it is wrong and I want to upload another code in that. What I have to do?

 int LMotorUp = 10;
 int LMotorDn = 11;
 int RMotorUp = 8;
 int RMotorDn = 9;

void setup()
{
  Serial.begin(9600);
  pinMode(LMotorUp,OUTPUT);
  pinMode(LMotorDn,OUTPUT);
  pinMode(RMotorUp,OUTPUT);
  pinMode(RMotorDn,OUTPUT);
  Serial.println("Arduino string");
}
void loop()
{
  if(Serial.available()>0)
  {
    int input = Serial.read();
    switch(input)
    {
      case 'w':MoveF();
      break;
      case 's':MoveB();
      break;
      case 'a':MoveL();
      break;
      case 'd':MoveR();
      break;
      case 'x':Stop();
      break;
      default:break;
    }
  }
  delay(50);
}

void MoveF()
{
  digitalWrite(LMotorUp,HIGH);
  digitalWrite(LMotorDn,LOW);
  digitalWrite(RMotorUp,HIGH);
  digitalWrite(RMotorDn,LOW);
}
void MoveB()
{
  digitalWrite(LMotorUp,LOW);
  digitalWrite(LMotorDn,HIGH);
  digitalWrite(RMotorUp,LOW);
  digitalWrite(RMotorDn,HIGH);
}
void MoveL()
{
  digitalWrite(LMotorUp,LOW);
  digitalWrite(LMotorDn,LOW);
  digitalWrite(RMotorUp,HIGH);
  digitalWrite(RMotorDn,LOW);
}
void MoveR()
{
  digitalWrite(LMotorUp,HIGH);
  digitalWrite(LMotorDn,LOW);
  digitalWrite(RMotorUp,LOW);
  digitalWrite(RMotorDn,LOW);
}
void Stop()
{
  digitalWrite(LMotorUp,LOW);
  digitalWrite(LMotorDn,LOW);
  digitalWrite(RMotorUp,LOW);
  digitalWrite(RMotorDn,LOW);
}
  • I don't have (and I doubt anyone else here has) the slightest clue what you are trying to ask there. I have never heard of an "Arduino Uno Com 12 board" or what it has to do with bluetooth. Please re-phrase your question and ask clearly what you need to know. Also, if you have to post code, please post it in a code block (highlight the code and select the {} button at the top of the editor). – Majenko Sep 12 '15 at 17:41
0

already Bluetooth code is installed or not?

No it is not. You need to find a suitable library.

I uploaded already one code, it is wrong and I want to upload another code ...

Upload another one then, it will replace the one you have there.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.