Hello guys,
I'm fairly new to the programming community, everything was going fine but I can't get PWM to work properly.
I connected a LED to pin 4 on port B (pin 10 PWM)
However, I can light the LED in this pin, but I can't control it with a PWM.
I've set the PWM channel to 10. This should be working right?
The PWM is enabled outside the loop and has a delay behind.
I think there some setup wrong somewhere but I can't find it... Even after a long search.
I've attached the program which I used.
Regards,
PWM not working on Arduino Mega 2560
Moderator: Benj
- 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: PWM not working on Arduino Mega 2560
Hello,
Which version of Flowcode are you using? Looks like a v5 file but could be v4?
Which version of Flowcode are you using? Looks like a v5 file but could be v4?
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
Re: PWM not working on Arduino Mega 2560
I'm sorry this is a V5 file. The new topic button disappeared in the V5 section for me. I don't know if this a known problem or if it only shows for me.
Re: PWM not working on Arduino Mega 2560
Well, I figured this out.
PWM pin 10 is Port B4 and channel 6. The pin number and channel confused me.
I found out after downloading V6. When using V6 the PWM component shows port output with the channel. Therefore I found out when connecting to channel 10 it was actually B7. And setting it to channel 6 it connected to pin 10.
I copied this action to the V5 version and it worked. Now considering buying FC V6. Just need to see if its worth the money (on first look its way more expanded than V5). I guess I have 30 days to think about it, lol.
PWM pin 10 is Port B4 and channel 6. The pin number and channel confused me.
I found out after downloading V6. When using V6 the PWM component shows port output with the channel. Therefore I found out when connecting to channel 10 it was actually B7. And setting it to channel 6 it connected to pin 10.
I copied this action to the V5 version and it worked. Now considering buying FC V6. Just need to see if its worth the money (on first look its way more expanded than V5). I guess I have 30 days to think about it, lol.
- 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: PWM not working on Arduino Mega 2560
Brilliant, thanks for letting us know.
Hope you enjoy the v6 30 day trial. Let us know if you have any problems.
Hope you enjoy the v6 30 day trial. Let us know if you have any problems.
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