Thanks a lot for ur kind reply...sorry for not pasting the program using # icon ...i have one more doubt , it would be very helpful if u clear it... whether i need to define " time = millis() " declaration outside the void loop() function ?
shobha23bhat:
need to define " time = millis() " declaration outside the void loop() function ?
From your question I understand you need a bit of c / c++ fundamentals beyond the following hint:
A declaration might be unsigned long time; which declares the data type of a variable and defines it.
In this case that definition can be made outside the loop() function - to have the variable available "globally",
or as well inside, to make it a temporary local variable.
** **time = millis();** ** calls a function and puts the result into that variable.
Such a function call can only happen inside another function.
The best way to learn the usage of millis() is the "Blink without delay" example.
Not sure how to learn c programming in general, but I guess the main issue is not to find one, but to learn what is relevant for Arduino programming.
Edit: a few less typos --> perhaps a bit more readable.