How to execute multiple steeps?

78 views
Skip to first unread message

Renato Barbosa Pim Pereira

unread,
May 17, 2013, 2:04:10 PM5/17/13
to accels...@googlegroups.com
I use a SD card to read the values for moveTo(), but when I send these values just the last is executed by the motor, can someone help me saying how can I pass multiples values to moveTo()?

void leitura()
{
 
  File arquivo = SD.open("entradas.txt");
while (arquivo.available()) {
  String mensagem;
 mensagem  += arquivo.parseInt();
 int     virgula;

  do

  {

      virgula = mensagem.indexOf(',');


         if(mensagem.length() > 0){
          
           
          
             valor2[i] = mensagem.toInt();
          Serial.println(valor2[i]);
    
         
         
    i++;

      }

   }

   while(virgula >=0);

}
   delay(500);
   stepper.moveTo(valor2[0]);
   delay(3000);
   stepper.moveTo(valor2[1]);

}

Reply all
Reply to author
Forward
0 new messages