Basically, I want to create a countdown timer. Which isn't hard. It's all over the web. BUT I would like to know how and what I would need for, when the timer reaches zero, the code commands a relay to close, allowing voltage to flow to something. Also, presetting the timer is a must and, if possible, checking for proper voltage going to the relay would be a HUGE plus. If the conditions aren't right, the program terminates and displays an error message explaining what went wrong.
I'm fairly new to C++ and am trying to learn everything correctly, but haven't been able to find any answers. I know this idea sounds crazy, but it's for a school project and I'd love to be able to figure it out.
Any help is greatly appreciated.
Edit: If the countdown timer could be displayed on a digital displays screen, instead of just in the program, that would be HUGE points for me. I know I'm gonna need to use some sort of serial port connection, a microcontroller (I think) and who-knows-what-else. If anybody could help, as well as point out the hardware I'd need to accomplish this, it would be a lifesaver.