i need help to do this

i need to do this.. Can i do this step in Arduino programming or help... i don't know how it doing
Bluetooth signal no 1 and i use servo motor i can fix it it's OK

if (x == '1'){
go and do that command
}
that command is
if ( int m=0; x<=180; x++){
servo.write(m);
delay(20);
}

Topic moved here from it's original location

What made you think that this question belonged in the forum section where you originally posted it ?

Please follow the advice on posting code given in posting code

In particular note the advice to Auto format code in the IDE and to use code tags when posting code here as it prevents some combinations of characters in code being interpreted as HTML commands such as italics, bold or a smiley character, all of which render the code useless

Like this?

 if (x == '1')
  {
     moveServo();
  }

void moveServo()
{
    // if ( int m=0; x<=180; x++){ *****  This makes no sense
  for( int m=0; x<=180; x++)
  {
     servo.write(m);
     delay(20);
  }
}

Your for loops should be

For ( int x=0;x<=180; x++)
{ Etc ...

So x increases in value , as you have it ‘ m’ is always zero

If you google “ Arduino for loop” you will get the reference page which shows an example

for( int m=0; x<=180; x++) :-[

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.