Dear all,
i have a problem with my program. I would like to use only one PWM-module for different channels respectively different pins.
The target is to create two different PWM-signals on different pins with only ONE PWM-module.
My idea was to change the variable for the channel in my main program.
So while the first PWM is running for example on the digital pin 5 with 400Hz, the digital pin 2 sends another PWM with for example 600Hz.
Back to my question.
Is it possible to change the channel properties of the module by a variable?
If you have another idea to create a program like this, let me know it.
Change module properties
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: Change module properties
Hello,
The channel is fixed in the compiled code and there is no easy way of changing this.
What device are you using? You may be able to change the remap options for a specific channel if your device has this available.
The channel is fixed in the compiled code and there is no easy way of changing this.
What device are you using? You may be able to change the remap options for a specific channel if your device has this available.
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: Change module properties
Thank you for your answer!
I'm using the Arduino Mega 2560 R3.
I tried to redefine the the options of the channel, but with no success.
I'm using the Arduino Mega 2560 R3.
I tried to redefine the the options of the channel, but with no success.
- 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: Change module properties
Aha ok, In that case you will probably need to use 2 different PWM components and use the enable disable component macros to allow one to be enabled and the other to be disabled.
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