Computer Science Canada how to put delays in procedures |
Author: | leafs911 [ Wed Jan 16, 2008 8:37 pm ] | ||
Post subject: | how to put delays in procedures | ||
hi i am trying make the LEDs blink.....i tired puting delay (number) and it did not work. i hope to get a reply tonight as this is due tomorrow. thanks
|
Author: | HeavenAgain [ Wed Jan 16, 2008 8:43 pm ] |
Post subject: | RE:how to put delays in procedures |
hehe, to make a LED blink, you gotta know how the "blink" work, when something blink, it gotta be on, and then off, and during the on time, there have to be a delay, and during the off time, there have to be another delay, so it is visible for the human eyes to see and then all you need is a for loop of how many times you want it to blink i hope it helps ![]() |
Author: | OneOffDriveByPoster [ Wed Jan 16, 2008 8:46 pm ] |
Post subject: | Re: how to put delays in procedures |
I think you have to parallelput something else after the delay and then delay again to make it "blink". |
Author: | leafs911 [ Wed Jan 16, 2008 8:47 pm ] |
Post subject: | RE:how to put delays in procedures |
so the for loop would that be in inside the procedures right? well ill try putting it in the procedures. thanks for the quick reply...i really appreciate it. |
Author: | HeavenAgain [ Wed Jan 16, 2008 8:49 pm ] |
Post subject: | RE:how to put delays in procedures |
not quite "something else", if you have 1010, and the 2nd bit is the LED, and you still want to keep the 4th bit on, so you parallelput 1000 to make ONLY the LED go off, and then 1010 to turn it back on again, so you dont lose any "information" there ![]() yes, i would put that for loop in the procedure, however when you call to that procedure there will be a "lag", because you have to wait for the blinking procedure to finish running the for loop try use process instead, and see what happens, this way it wont interrupt your whole program ![]() |