LED on pwm on arduino

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
Bill Felker
Flowcode v5 User
Posts: 47
Joined: Tue Sep 24, 2013 7:21 pm
Has thanked: 18 times
Been thanked: 12 times
Contact:

LED on pwm on arduino

Post by Bill Felker »

Can someone give a example of lighting a LED on digital pin #9 as a pwm. My attempts seem to be coming up short. I have the the LED wire threw a resistor to ground and when I use the LED component macro it lights fine but on the simulation my pwm meter work like it should but in actual circuit not light from the LED. Thanks in advance . Bill

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: LED on pwm on arduino

Post by Benj »

Hi Bill,

Can you attach your program so far so we can see what your trying and hopefully point you in the right direction. Otherwise we are guessing about your type of Arduino etc..

Bill Felker
Flowcode v5 User
Posts: 47
Joined: Tue Sep 24, 2013 7:21 pm
Has thanked: 18 times
Been thanked: 12 times
Contact:

Re: LED on pwm on arduino

Post by Bill Felker »

Sorry I forgot to attach it.
Attachments
uno_led_test_pwm.fcfx
(5.85 KiB) Downloaded 392 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: LED on pwm on arduino

Post by Benj »

Hi Bill,

No problems here is a example that should ramp up the LED brightness and then ramp back down.
uno_led_test_pwm.fcfx
(6.09 KiB) Downloaded 417 times

Bill Felker
Flowcode v5 User
Posts: 47
Joined: Tue Sep 24, 2013 7:21 pm
Has thanked: 18 times
Been thanked: 12 times
Contact:

Re: LED on pwm on arduino

Post by Bill Felker »

Thanks for the sketch. I still am not getting the LED to light with pwm .Do I need the LED to be connected threw the resistor to ground or to the 5 v? I can get it to work using the Arduino compiler in "C" but not threw the flowcode software.
Bill :?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: LED on pwm on arduino

Post by Benj »

Hello,

Sorry the example I gave had the PWM component set to the wrong output pin, it should now be on pin D9 as you stated.
uno_led_test_pwm-1.fcfx
(6.1 KiB) Downloaded 417 times

Bill Felker
Flowcode v5 User
Posts: 47
Joined: Tue Sep 24, 2013 7:21 pm
Has thanked: 18 times
Been thanked: 12 times
Contact:

Re: LED on pwm on arduino

Post by Bill Felker »

Thank you , once again you have come threw and shown me how to do something in Flowcode. It works well. Now all I have to do is figure out how you decide which PWM pin get selected on this and I will be on my way. Thanks again, you guys never cease to answer a question that even I can wrap my head around it. Bill :D

Bill Felker
Flowcode v5 User
Posts: 47
Joined: Tue Sep 24, 2013 7:21 pm
Has thanked: 18 times
Been thanked: 12 times
Contact:

Re: LED on pwm on arduino

Post by Bill Felker »

LOL, now that was easy . I looked at your 1st example and saw in the properties menu where you list each channel of PWM and saw that they have a output pin associated with it and that I kept using PWM1 in my program which would then relate to $PORTD.6 . Lesson learned - thank you once again. :wink: Bill

Post Reply