We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi I switch the light on, and want a timer to hold the light for 5 sec. How do I do that?? Please help! Thanks in advance. /Thomas
Hi Thomas! I think your using a different toolset, think that its a c51 toolset. Think this will work:
unsigned int time = -5000; // Set timer 0 til mode 0 TMOD = (TMOD & 0xf0) | 0x01; // Timer mode TL0 = time % 256; // Reset timer TH0 = time / 256; // Reload timer TR0 = 1; // Timer run