Hi!
My arduino project is about phone controlled robots. I'm using bluetooth to connect my phone to a bluetooth hc-06 module. I think that I'm going to use a switch case statement. I'm new at programming, and I wonder if you can say like this:
case 'U': {
if case'U'&&'R'
motor1.run(BACKWARD);
motor2.run(FORWARD);
motor3.run(BACKWARD);
motor4.run(FORWARD);
motor1.setSpeed(255);
motor2.setSpeed(255);
motor3.setSpeed(255);
motor4.setSpeed(255);
if case 'U'&&'L'
motor1.run(FORWARD);
motor2.run(BACKWARD);
motor3.run(FORWARD);
motor4.run(BACKWARD);
motor1.setSpeed(255);
motor2.setSpeed(255);
motor3.setSpeed(255);
motor4.setSpeed(255);
}break;
I want arduino to first check if a 'U' is comming, and then check if 'U' is comming with a 'R' or 'L' and do different things depending to wich of the cases i'm sending out.
'U' is backlights on, 'L' is spin left and 'R' is spin right. I mean that if the backlights is on and the spin left button (or right) is pressed, should the motors drive like in the code above.