Esplora setup loop problem?

I’m trying to write code that lets me use Esplora board to control a robot. When I start the code, it is supposed to set up the servos to center position but nothing happens until I press the joystick button. How can I fix the problem?

#include <Esplora.h>
int walkflag;
void setup() 
{
  Serial1.begin(115200);
  if (Serial1.available())
  {
    robotstand01; < nothing happens here
    delay(500);
  }  
}
void loop() 
{
  if(Esplora.readJoystickButton()==LOW)
  {
    walkflag = 0;
    robotstand01(); < it works.
  }  
  if(Esplora.readButton(JOYSTICK_UP)==LOW)
  {
    walkflag = 1;
    robotwalk01();
    robotwalk02();
    robotwalk03();
    robotwalk04();
    robotwalk05();
    robotwalk06();
    robotwalk07();
    robotwalk08();
    robotwalk09();
  }  
  //if(Esplora.readButton(JOYSTICK_DOWN)==LOW)
  //{
    //robotwalk01();
    //delay(1000);
    //robotwalk02();
    //delay(1000);
    //robotwalk03();
    //delay(1000);
    //robotwalk04();
    //delay(1000);
    //robotwalk05();
    //delay(1000);
    //robotwalk06();
    //delay(1000);
  //}  
}  
void robotstand01()
{
  Serial1.print("#0 P1500 T500 \r ");
  Serial1.print("#1 P1500 T500 \r ");
  Serial1.print("#2 P1500 T500 \r ");
  Serial1.print("#4 P1500 T500 \r ");
  Serial1.print("#5 P1500 T500 \r ");
  Serial1.print("#6 P1500 T500 \r ");
  Serial1.print("#8 P1500 T500 \r ");
  Serial1.print("#9 P1500 T500 \r ");
  Serial1.print("#10 P1500 T500 \r ");
  Serial1.print("#16 P1500 T500 \r ");
  Serial1.print("#17 P1500 T500 \r ");
  Serial1.print("#18 P1500 T500 \r ");
  Serial1.print("#20 P1500 T500 \r ");
  Serial1.print("#21 P1500 T500 \r ");
  Serial1.print("#22 P1500 T500 \r ");
  Serial1.print("#24 P1500 T500 \r ");
  Serial1.print("#25 P1500 T500 \r ");
  Serial1.print("#26 P1500 T500 \r ");
  delay(500);
}
void robotwalk01()
{
  Serial1.print("#0 P1500 T500 \r ");
  Serial1.print("#1 P1667 T500 \r ");
  Serial1.print("#2 P1667 T500 \r ");
  Serial1.print("#4 P1500 T500 \r ");
  Serial1.print("#5 P1500 T500 \r ");
  Serial1.print("#6 P1500 T500 \r ");
  Serial1.print("#8 P1500 T500 \r ");
  Serial1.print("#9 P1667 T500 \r ");
  Serial1.print("#10 P1667 T500 \r ");
  Serial1.print("#16 P1500 T500 \r ");
  Serial1.print("#17 P1500 T500 \r ");
  Serial1.print("#18 P1500 T500 \r ");
  Serial1.print("#20 P1500 T500 \r ");
  Serial1.print("#21 P1667 T500 \r ");
  Serial1.print("#22 P1667 T500 \r ");
  Serial1.print("#24 P1500 T500 \r ");
  Serial1.print("#25 P1500 T500 \r ");
  Serial1.print("#26 P1500 T500 \r ");
  delay(500);
}
<rest of code>

jeffmorris:
I’m trying to write code that lets me use Esplora board to control a robot. When I start the code, it is supposed to set up the servos to center position but nothing happens until I press the joystick button. How can I fix the problem?

    robotstand01; < nothing happens here


   robotstand01(); < it works.

Seriously?

  Serial1.begin(115200);
  if (Serial1.available())
  {

How much serial data do you suppose is going to arrive between opening the serial port and checking for the presence of data? How much data will arrive in that 62.5 nanoseconds? Hint, less than one byte,

I need new pair of eyes - I forgot to put () after robotstand01 in setup loop.