Page 1 of 1
dynamic led
Posted: Fri Sep 21, 2012 2:51 pm
by donald
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.
Re: dynamic led
Posted: Fri Sep 21, 2012 3:06 pm
by Enamul
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
Posted: Fri Sep 21, 2012 3:18 pm
by donald
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?
Re: dynamic led
Posted: Fri Sep 21, 2012 3:27 pm
by Enamul
Hi,
Click in the play button in the menu...as shown in the picture
Re: dynamic led
Posted: Fri Sep 21, 2012 3:34 pm
by donald
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.
Re: dynamic led
Posted: Fri Sep 21, 2012 3:47 pm
by Enamul
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..
Re: dynamic led
Posted: Fri Sep 21, 2012 6:13 pm
by donald
Led to the port (A1) and (A2) light up simultaneously on breadboard, why is that?
Re: dynamic led
Posted: Fri Sep 21, 2012 6:55 pm
by Enamul
Sorry..I made some mistake in hex value...now it should be fine
Re: dynamic led
Posted: Fri Sep 21, 2012 7:43 pm
by donald
It works now, you have been of help,thank you that you have occupied the matter.
Re: dynamic led
Posted: Sat Sep 22, 2012 12:57 pm
by donald
Hi,
Led 5 illuminated simultaneously with led 2,
I can't turn off led 2.
Re: dynamic led
Posted: Sat Sep 22, 2012 2:48 pm
by petesmart
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.
Re: dynamic led
Posted: Sat Sep 22, 2012 4:03 pm
by medelec35
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
Re: dynamic led
Posted: Sat Sep 22, 2012 4:07 pm
by donald
Hi Pete,
I set all leds to zero and behaves the same way I stated above.
You can set port A0 inactive?
Re: dynamic led
Posted: Sat Sep 22, 2012 4:10 pm
by medelec35
Hi donald, Just edited my post at the same time you posted.
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
Re: dynamic led
Posted: Sat Sep 22, 2012 4:27 pm
by donald
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.
Re: dynamic led
Posted: Sat Sep 22, 2012 4:33 pm
by medelec35
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
Re: dynamic led
Posted: Sat Sep 22, 2012 4:55 pm
by donald
Hi Martin,
That's pretty much the way it would be drawing if I am right.
Re: dynamic led
Posted: Sat Sep 22, 2012 5:58 pm
by medelec35
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
Re: dynamic led
Posted: Sat Sep 22, 2012 6:12 pm
by donald
Hi Martin,
Thank you very much, I would play less than to see how it works.
Re: dynamic led
Posted: Sun Sep 23, 2012 6:49 pm
by donald
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!