Change module properties

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

Moderator: Benj

Post Reply
Testing24
Posts: 3
Joined: Thu Jun 06, 2019 9:13 am
Contact:

Change module properties

Post by Testing24 »

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.

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: Change module properties

Post by Benj »

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.

Testing24
Posts: 3
Joined: Thu Jun 06, 2019 9:13 am
Contact:

Re: Change module properties

Post by Testing24 »

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.

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: Change module properties

Post by Benj »

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.

Post Reply