Renato Barbosa Pim Pereira
unread,May 17, 2013, 2:04:10 PM5/17/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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]);
}