LED on pwm on arduino
Moderator: Benj
-
- Flowcode v5 User
- Posts: 47
- Joined: Tue Sep 24, 2013 7:21 pm
- Has thanked: 18 times
- Been thanked: 12 times
LED on pwm on arduino
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
- 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
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..
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..
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Flowcode v5 User
- Posts: 47
- Joined: Tue Sep 24, 2013 7:21 pm
- Has thanked: 18 times
- Been thanked: 12 times
Re: LED on pwm on arduino
Sorry I forgot to attach it.
- Attachments
-
- uno_led_test_pwm.fcfx
- (5.85 KiB) Downloaded 413 times
- 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
Hi Bill,
No problems here is a example that should ramp up the LED brightness and then ramp back down.
No problems here is a example that should ramp up the LED brightness and then ramp back down.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Flowcode v5 User
- Posts: 47
- Joined: Tue Sep 24, 2013 7:21 pm
- Has thanked: 18 times
- Been thanked: 12 times
Re: LED on pwm on arduino
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
Bill

- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Flowcode v5 User
- Posts: 47
- Joined: Tue Sep 24, 2013 7:21 pm
- Has thanked: 18 times
- Been thanked: 12 times
Re: LED on pwm on arduino
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 

-
- Flowcode v5 User
- Posts: 47
- Joined: Tue Sep 24, 2013 7:21 pm
- Has thanked: 18 times
- Been thanked: 12 times
Re: LED on pwm on arduino
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.
Bill
