By Semaphore you mean?
By Semaphore you mean?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
What do you want to control the speed with? A pot or have a set of pre determined speeds selected by button pushes or some other manner?
Dave
Always wear safety glasses while programming.
First we need to work on the schematic. The way it is drawn the red and green leds will never light up. Yellow is OK.
You will also want it rigged so if a green is on the corresponding red at the other fixture will be off.
Take a look here and see if you want to use a configuration something like the drawing with three pins (with a little tweaking)
http://www.mackrackit.com/mac/www/dave/LED/LEDs.html
Dave
Always wear safety glasses while programming.
That is doable. If GP4 is LOW, making GP0 or GP1 or GP2 High will make the connected LED light. The same for GP5.
Being I do not know the sequence you want them to light here is an idea.
Your code will have the "blinking" sequence with multiple pauses. The value of the pauses will be held in a variable. A button will connect to GP3 as an interrupt. Every time the button is pushed the variable will increase by the amount you want. Once the highest value is reached the variable will reset to the lowest.
Maybe something like that will work for you.Code:"VARIABLES X VAR WORD:Y VAR WORD:Z VAR WORD ON INTERRUPT GOTO MYINT INTCON=%10001000 IOC = %00001000 '############## 'YOUR SEQUENCE '############## DISABLE MYINT: IF GPIO.3 = 1 THEN X = X * 10 Y = Y ??? Z = Z ??? pause 100 IF X => ? THEN X = ?? IF Y => ? THEN Y = ?? IF Z => ? THEN Z = ?? INTCON.1 = 0 RESUME ENABLE
Dave
Always wear safety glasses while programming.
Bookmarks