So i decided to use a hidden variable in Pinguino, _millis. This variable is used in the arduinodelay library and is incremented every milli second. I copied this example of my code:
#include <string.h>
unsigned char caractere;
unsigned char chaine[50];
long tempo;
unsigned char index;
unsigned char gsm_echo(unsigned char state)
{
Serial.flush();
_millis=0;
index=0;
if (state) Serial.print("ATE1\r");
else Serial.print("ATE0\r");
while (_millis<100)
{
if Serial.available()
{
caractere=Serial.read();
chaine[index]=caractere;
index++;
}
}
chaine[index]=0;
if (strstr(chaine,"OK")!=0) return 0;
else return 1;
}
void setup()
{
Serial.begin(9600);
pinMode(0,OUTPUT);
digitalWrite(0,LOW);
tempo=millis();
}
void loop()
{
debut:
delay(500);
if (gsm_echo(0)==1) goto debut;
delay(500);
digitalWrite(0,HIGH);
while (1);
}
The millis instruction in the setup function is just used to initialise the library.
_millis variable is already declared in the arduinodelay library.
Hope it will be useful for everybody.






