Multiple pots in program move in unison

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

Moderator: Benj

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

Postby E*2Engineer » Tue Mar 15, 2016 4:40 am

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.jpg
Smart one on right
Smart one on right.jpg (34.42 KiB) Viewed 6588 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 246 times

User avatar
Benj
Matrix Staff
Posts: 14574
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4603 times
Been thanked: 4241 times
Contact:

Re: Multiple pots in program move in unison

Postby Benj » Tue Mar 15, 2016 10:49 am

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

Postby E*2Engineer » Tue Mar 15, 2016 10:23 pm

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

Postby E*2Engineer » Wed Mar 16, 2016 5:14 am

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: 1962
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 474 times
Been thanked: 674 times
Contact:

Re: Multiple pots in program move in unison

Postby LeighM » Wed Mar 16, 2016 10:53 am

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: 1962
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 474 times
Been thanked: 674 times
Contact:

Re: Multiple pots in program move in unison

Postby LeighM » Wed Mar 16, 2016 11:54 am

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 207 times
test_mux.fcfx
(4.62 KiB) Downloaded 206 times
mux16.fcfx
(10.46 KiB) Downloaded 206 times
These users thanked the author LeighM for the post (total 2):
E*2Engineer (Thu Mar 17, 2016 3:00 am) • medelec35 (Thu Mar 17, 2016 6:27 am)
Rating: 10.53%
 

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

Postby E*2Engineer » Thu Mar 17, 2016 3:05 am

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
These users thanked the author E*2Engineer for the post:
Benj (Tue May 17, 2016 3:11 pm)
Rating: 5.26%
 

User avatar
LeighM
Matrix Staff
Posts: 1962
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 474 times
Been thanked: 674 times
Contact:

Re: Multiple pots in program move in unison

Postby LeighM » Thu Mar 17, 2016 9:26 am

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
These users thanked the author LeighM for the post:
E*2Engineer (Thu Mar 17, 2016 2:05 pm)
Rating: 5.26%
 

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

Postby E*2Engineer » Thu Mar 17, 2016 2:13 pm

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
These users thanked the author E*2Engineer for the post (total 2):
LeighM (Thu Mar 17, 2016 3:26 pm) • Benj (Tue May 17, 2016 3:11 pm)
Rating: 10.53%
 

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

Postby mossine » Sun May 15, 2016 7:13 am

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: 14574
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4603 times
Been thanked: 4241 times
Contact:

Re: Multiple pots in program move in unison

Postby Benj » Mon May 16, 2016 2:11 pm

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

Postby mossine » Tue May 17, 2016 2:56 pm

hi Benj
thanks ;
i must change to flowcode v6