Adding a timer in a C++ program

Apr 26, 2008 at 12:18am
Im using a OOPic-R microprocessor for a school project. The basic thing Im looking for to is to light up an LED (which I can do already), however Im trying to write a program to light up the LED for a curtain period of time. This isn't the main program, however it is a big part of it. Can anyone help me out?
Apr 26, 2008 at 1:27am
So far this is the program i have. It lights up two LEDs and keeps the LEDs lit up till the power is disconnected, and I want to get the LEDs to light up for about 5 seconds or so, then shut off. If anyone can help, that would be great. :)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 

'This program causes I/O Line 9 and 10 
'to control a Dual colored LED.

oLED2 l = New oLED2;

Void Main(Void){
  l.A.IOLine = 9;
  l.B.IOLine = 11;
  Do{
    l.A.Flash
    l.B.Flash
  } While (1)  
}

Topic archived. No new replies allowed.