dynamic led
Moderator: Benj
dynamic led
Hello,
The Flowcode can simulate the illumination of a led between two ports ?
I have here a flowchart where I want to light up 3 leds one after another.
The Flowcode can simulate the illumination of a led between two ports ?
I have here a flowchart where I want to light up 3 leds one after another.
- Attachments
-
- dynamic led.fcf
- (19.91 KiB) Downloaded 347 times
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: dynamic led
Yes you can. I have seen your program but in the figure there is no current limiting resistor..you have to add current limiting resistor for LEDs. You can use port mask pin commands to run LED rather than bit wise command.
Re: dynamic led
Hi Enamul,
I have not made resistor to limit current to that they are in the stage of simulation,
but I don't know how to do the flowcode simulation.
Can you show me in flowchart?
I have not made resistor to limit current to that they are in the stage of simulation,
but I don't know how to do the flowcode simulation.
Can you show me in flowchart?
Re: dynamic led
Enamul not, I don't think you understand, if you look in the flochart the three leds do not light up
one after another, this means that leds have a reference point to the ground and I want to light up
between ports and not towards the ground.
one after another, this means that leds have a reference point to the ground and I want to light up
between ports and not towards the ground.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: dynamic led
Ok..I got now your points..in FC LEDs are simulated in respect of GND and you will not be able to get that what you are looking for..In that case you need to have facility to assign anode and cathode terminal separately but FC doesn't allow you to do that. I think no PIC simulator allow you this. Obviously you can get that in hardware..
- Attachments
-
- dynamic led.fcf
- slightly modifies your code
- (19.25 KiB) Downloaded 308 times
Re: dynamic led
Led to the port (A1) and (A2) light up simultaneously on breadboard, why is that?
- Attachments
-
- dynamic led v.2.fcf
- (19.24 KiB) Downloaded 287 times
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: dynamic led
Sorry..I made some mistake in hex value...now it should be fine
- Attachments
-
- dynamic led.fcf
- (19.22 KiB) Downloaded 318 times
Re: dynamic led
Hi,
Led 5 illuminated simultaneously with led 2,
I can't turn off led 2.
Led 5 illuminated simultaneously with led 2,
I can't turn off led 2.
- Attachments
-
- dynamic led v.3.fcf
- (8.5 KiB) Downloaded 340 times
- petesmart
- Valued Contributor
- Posts: 395
- Joined: Thu May 06, 2010 11:42 am
- Location: Sydney, Australia
- Has thanked: 187 times
- Been thanked: 140 times
Re: dynamic led
Hi Donald,
is this what your looking for... i set all of the LEDs to off at the start of the loop, it now cycles around with all LEDs off to begin the sequence.
I hope i have understood your requirement
all the best
Pete.
is this what your looking for... i set all of the LEDs to off at the start of the loop, it now cycles around with all LEDs off to begin the sequence.
I hope i have understood your requirement
all the best
Pete.
sorry about that Chief!
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: dynamic led
The problem your facing is because your using LED's connected to two pins rather than one pin and a supply.
Your using pins as i/p and o/p as you will need the pins to have 3 states.
1) O/P = High
2) O/P = Low
3) Tristate = configured as i/p
As Enamul stated Flowcode will not be able to simulate that.
If you would like to post a circuit diagram of how your LEDS are connected, then a working flowchart can be produced for you.
However its not worth running flowchart simulator as you may not think its going to work, as it will only work on your hardware.
So please (if not already done so) only test on hardware before stating if all is working ok or not
Martin
Your using pins as i/p and o/p as you will need the pins to have 3 states.
1) O/P = High
2) O/P = Low
3) Tristate = configured as i/p
As Enamul stated Flowcode will not be able to simulate that.
If you would like to post a circuit diagram of how your LEDS are connected, then a working flowchart can be produced for you.
However its not worth running flowchart simulator as you may not think its going to work, as it will only work on your hardware.
So please (if not already done so) only test on hardware before stating if all is working ok or not
Martin
Martin
Re: dynamic led
Hi Pete,
I set all leds to zero and behaves the same way I stated above.
You can set port A0 inactive?
I set all leds to zero and behaves the same way I stated above.
You can set port A0 inactive?
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: dynamic led
Hi donald, Just edited my post at the same time you posted.
I just added:
Thanks
I just added:
medelec35 wrote: Your using pins as i/p and o/p as you will need the pins to have 3 states.
1) O/P = High
2) O/P = Low
3) Tristate = configured as i/p
Thanks
Martin
Re: dynamic led
Hi Martin,
Yes that's right i have posted almost at the same time. I have to come back with a scheme,
I have seen that it is functioning, it is purchased and leds are connected between the two ports.
Yes that's right i have posted almost at the same time. I have to come back with a scheme,
I have seen that it is functioning, it is purchased and leds are connected between the two ports.
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: dynamic led
If you got no means of creating a schematic , then just state something like:
LED1
a = portB0
k = portB1
LED2
a = portB1
k = portB0
LED3
a = portB0
k = 0V
etc
LED1
a = portB0
k = portB1
LED2
a = portB1
k = portB0
LED3
a = portB0
k = 0V
etc
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: dynamic led
Hi donald,
Hopefully I have got LED 1 - 4 correct
Only completed 4LEDs because1)
May not be correct and 2) just to give you an idea on how to do it if all works.
IMPORTANT: You must connect a 220R limiting resistor in series with each pin of port and pair of diodes.
Martin
Hopefully I have got LED 1 - 4 correct
Only completed 4LEDs because1)
May not be correct and 2) just to give you an idea on how to do it if all works.
IMPORTANT: You must connect a 220R limiting resistor in series with each pin of port and pair of diodes.
Martin
- Attachments
-
- dynamic led v.4.fcf
- (14.44 KiB) Downloaded 226 times
Martin
Re: dynamic led
Hello to all over the world,
Mr. Martin will be thank you for your help and solve excellence of the question.
Also thank Enamul and Pete.
All the best!
Mr. Martin will be thank you for your help and solve excellence of the question.
Also thank Enamul and Pete.
All the best!