function millis() in pure C


hi, have problem, i'm trying make simple timer on arduino mini pro. when wrote code in wiring, worked correctly, when wrote code in c, function millis()  returning value 0.  there code  (i'm using library display nokia 5110, , can display text, or variable in string):

int main(){

char text[10];
int time;

while(1){
                  time=millis()/1000;
                  sprintf(text"%d",time);
                  lcd.lcdstring(text);
               }

return 0;
}


if can not understand, please tell me, english not excellent, , made mistake :)
thanks every answer or opinion.

time should @ least unsigned long


Arduino Forum > Using Arduino > Programming Questions > function millis() in pure C


arduino

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support