I am working with an RTC and have trouble declaring now in this scope:
unsigned char hourpos = (now.hour()%12)*5;
Basically I would just like a quick example of what I would have to write.
Thank you!
I am working with an RTC and have trouble declaring now in this scope:
unsigned char hourpos = (now.hour()%12)*5;
Basically I would just like a quick example of what I would have to write.
Thank you!
Include the appropriate time library.
Hey sorry for leaving that out and thank you for letting me know!
It won't verify, because it gives me the error message:
exit status 1
request for member 'hour' in 'now', which is of non-class type 'time_t() {aka long unsigned int()}'
I guess I just don't understand where to declare that hour and also how to write it?
Hope this is giving more insight
Banana28:
I am working with an RTC and have trouble declaring now in this scope:unsigned char hourpos = (now.hour()%12)*5;
Basically I would just like a quick example of what I would have to write.
You have not given us enough information. With so little information, we don't understand the problem well enough to be able to help you.
Lines of code do not exist in a vacuum. Depending on where it is in your sketch, and what else is in your sketch, the same line of code can do the right thing, or do the wrong thing, or fail to do anything at all.
Please post your entire sketch as you now have it, so that we can understand the issue better.