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.
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
Post a Comment