3 switches 1 reset
Moderator: Benj
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 24 times
- Contact:
3 switches 1 reset
hi all i have 3 leds and a switch assigned to each led only 1 led can be lit at any time if another led is required to be on then using a reset button common to all 3 leds this extinguishes the led and the button for the required led can be pressed to light it, trouble is i cannot get led 3 to light also on hardware is does not work although in flowcode sim the first two leds work i have tried in a previous flowchart using decision icons in stead of the switch but any button would extinguish the led any help please
- Attachments
-
- switch.fcf
- (17.77 KiB) Downloaded 181 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: 3 switches 1 reset
Hi siliconchip,
Can you give this a try please.
I have deleted the unused variables so u know what variable are involved.
Martin
Can you give this a try please.
I have deleted the unused variables so u know what variable are involved.
Martin
- Attachments
-
- switch V2.fcf
- (13.5 KiB) Downloaded 186 times
Martin
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 24 times
- Contact:
Re: 3 switches 1 reset
hi martin thanks for the reply i have just used your version on hardware (mikroelektronika easy pic 5 board ) it is working some of the time but occasionally if a button is pressed 2 leds will light instead of 1
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: 3 switches 1 reset
Hi siliconchip,
Your welcome.
I have just set my hardware up so Switches connected to port A & LEDs connected to port B.
unfortunately I can't get more than one LED on at the same time
Can you tell me which switch you pressed to get more than one LED on please so I can see if I replicate the issue.
Could you have a hardware fault like two shorting LEDs?
Your welcome.
I have just set my hardware up so Switches connected to port A & LEDs connected to port B.
unfortunately I can't get more than one LED on at the same time
Can you tell me which switch you pressed to get more than one LED on please so I can see if I replicate the issue.
Could you have a hardware fault like two shorting LEDs?
Martin
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 24 times
- Contact:
Re: 3 switches 1 reset
i got 2 leds on by pressing button A0 and same thing happened on A1 button not sure about the shorting on my board so tried a night rider led program as a test and this worked ok
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: 3 switches 1 reset
Odd. I can't get mine to play up.
Just in case I have missed something.I have altered Flowchart to make it impossible for more than 1 LED to be on.
Can you try this one please.
No debouncing is required since as soon as any of the on switches are detected, all switches except reset are locked out.
Martin
Just in case I have missed something.I have altered Flowchart to make it impossible for more than 1 LED to be on.
Can you try this one please.
No debouncing is required since as soon as any of the on switches are detected, all switches except reset are locked out.
Martin
- Attachments
-
- switch V2.fcf
- (15.21 KiB) Downloaded 210 times
Martin
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 24 times
- Contact:
Re: 3 switches 1 reset
hi martin just tried the flowchart using hardware and it works great there is no interferance from other switches with leds etc and its working a treat once again a big thankyou i now understand the masking concept a little better
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: 3 switches 1 reset
Hi siliconchip,
Your welcome
Glad latest one is working better for you.
Thanks for letting us know.
Martin
Your welcome
Glad latest one is working better for you.
Thanks for letting us know.
Martin
Martin