Multiple pots in program move in unison

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

Moderator: Benj

Post Reply
User avatar
E*2Engineer
Posts: 35
Joined: Wed Dec 25, 2013 6:54 pm
Has thanked: 12 times
Been thanked: 6 times
Contact:

Multiple pots in program move in unison

Post by E*2Engineer »

Hello people,
The program attached has 4 potentiometers in it, with only 2 involved in the start of this program,
and for some reason, if I move any one of them, they all turn equally and simultaneously amount.
Strangely enough, I would prefer them to move individually. :o

What simple, stupid thing am I doing wrong?
Thanks,
-Craig C
Attachments
Smart one on right
Smart one on right
Smart one on right.jpg (34.42 KiB) Viewed 10731 times
CODE PROGRESS 3 13 16 2348.fcfx
This is just the start of the coding, the led bar at the top represents the B port output. (Which mux output is selected)
Rest of coding will be completed when pots can be turned individually.
(20.03 KiB) Downloaded 423 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: Multiple pots in program move in unison

Post by Benj »

Hello Craig,

If you look at the properties for each ADC component then you will see they are all connected to same analogue channel AN0.

If you change the channels so that each ADC has it's own ADC channel then they should work independently as you are expecting.

User avatar
E*2Engineer
Posts: 35
Joined: Wed Dec 25, 2013 6:54 pm
Has thanked: 12 times
Been thanked: 6 times
Contact:

Re: Multiple pots in program move in unison

Post by E*2Engineer »

But I have so many analog inputs in my project, I will be using a MUX to change from 1 signal to the next. It shows that in my program.
I first choose an input using the output of Channel B, going to a MUX then I sample the selected signal. Any way to sim this?
If I can't get to simulate this in the software, it's going to make my programming much tougher.
-CC

User avatar
E*2Engineer
Posts: 35
Joined: Wed Dec 25, 2013 6:54 pm
Has thanked: 12 times
Been thanked: 6 times
Contact:

Re: Multiple pots in program move in unison

Post by E*2Engineer »

Benj,
That will get me by on the 1st 8 Analog inputs, but I have 16 analog voltages to read, all from separate sources.
And even then it would mean I couldn't use the code the way it will be written/ run in the actual project, making it a exercise in futility.

The 16 channels will be coming from potentiometers and sensors. It just worked out to 16, it has nothing to do with 2 bytes worth of data. This works well with my
4067 16 channel MUX. I plan on running all signals through the 4067, 4 to 16 channel MUX output to 1 (AN0) A/D input.

I assume at this point that there is no way to use this type design on the FC6 simulator?
-CC

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Multiple pots in program move in unison

Post by LeighM »

One idea...
The 4067 could be simulated by creating a new component which uses 16 sliders (see simulation controls)
The component would also have macros created for setting the channel and reading back the value.
So the component would have "downloadable" macros to set the mux outputs and read the AN0 value,
and also simulation versions to save the channel number and then return the correct slider value.

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Multiple pots in program move in unison

Post by LeighM »

Hi,
I've put together a very quick starter, attached.
Currently only has 4 channels, but you can see what needs to be done.
Hope it helps.
Leigh
Attachments
mux16.fcpx
(1.68 KiB) Downloaded 377 times
test_mux.fcfx
(4.62 KiB) Downloaded 379 times
mux16.fcfx
(10.46 KiB) Downloaded 386 times

User avatar
E*2Engineer
Posts: 35
Joined: Wed Dec 25, 2013 6:54 pm
Has thanked: 12 times
Been thanked: 6 times
Contact:

Re: Multiple pots in program move in unison

Post by E*2Engineer »

LeighM,

i really like your solution, And thanks so much for the start of the code needed, I would have had some problems without it, as I am still learning FC6.

Are 2 of the 3 variants of the program for 32 or 64 bit? test_mux.fcfx opened right up on my Win 7 64 bit computer.
And mux16.fcpx was not recognized by my version FC6.
Cheers!
Craig C

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Multiple pots in program move in unison

Post by LeighM »

Glad it was of help.

mux16.fcpx is the actual component that needs to be copied into your Flowcode/components directory.
mux16.fcfx is the source code for the component, so you can edit and add to that, then "Export Component" from the File menu.
That will then re-create the component and overwrite mux16.fcpx

Leigh

User avatar
E*2Engineer
Posts: 35
Joined: Wed Dec 25, 2013 6:54 pm
Has thanked: 12 times
Been thanked: 6 times
Contact:

Re: Multiple pots in program move in unison

Post by E*2Engineer »

Leigh,
This was more than a solution, it was a great bit of usable information in making components, and programming as well.
Very useful for all other projects.
Thanks again,
-Craig

mossine
Posts: 35
Joined: Mon Jun 17, 2013 2:09 am
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Multiple pots in program move in unison

Post by mossine »

LeighM wrote:Hi,
I've put together a very quick starter, attached.
Currently only has 4 channels, but you can see what needs to be done.
Hope it helps.
Leigh
hi everyone

hi "LeighM" ;
pleas can you upload your examples with flowcode V5 .
i need this examples
thank you

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: Multiple pots in program move in unison

Post by Benj »

Hello Mossine,

I don't think that this is something Flowcode v5 can do.

mossine
Posts: 35
Joined: Mon Jun 17, 2013 2:09 am
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Multiple pots in program move in unison

Post by mossine »

hi Benj
thanks ;
i must change to flowcode v6

Post Reply