Quote:
Originally Posted by de_
On one line have an (12v) Red LED connected and be able to turn it on and off without effecting the state of what is on the other line of the spike. On the other line, we want to have a white 12v led that we flash in software, again, not effecting the Red LED.
|
The two processes will have to
cooperate to achieve what you want.
Let the 4 possible states of the Spike outputs be:
Code:
White Red
1) OFF OFF
2) OFF ON
3) ON OFF
4) ON ON
Then, to flash the Red LED on/off while the White one is OFF, you would alternate between states 1 & 2.
But to flash the Red LED on/off while the White one is ON, you would alternate between states 3 & 4.
So the process which flashes the Red LED cannot act independently from the process which flashes the White LED, and vice-versa. The processes must share information.
One way to do this would be to have each process just set a boolean flag to indicate whether its LED should be ON or OFF, and let a third process set the proper state of the Spike each time either of these booleans changes. Rather than having the third process chew up resources polling, you could use some sort of messaging supported by the vxworks OS.