Switch array

For general Flowcode discussion that does not belong in the other sections.
Post Reply
siliconchip
Posts: 47
http://meble-kuchenne.info.pl
Joined: Wed Dec 16, 2020 10:38 am
Has thanked: 18 times
Been thanked: 1 time

Switch array

Post by siliconchip »

Hi all
When using the switch array ive noticed the number and lettering go from right to left is there a way to change this to left to right ive looked in properties but unable to correct it cheers

Bob

chipfryer27
Valued Contributor
Posts: 2049
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 450 times
Been thanked: 674 times

Re: Switch array

Post by chipfryer27 »

Hi

I haven't seen a way to flip the layout direction or orientation other than view Horizontal or Vertical, so not sure if this will help or not.

I may wrongly be assuming that you are using the array as it is an easy way to check for activity as all inputs are read as, for example, a Byte.

If you had the array connected to 8 x ports on a PIC, for example say Port_B0 - B7, then depending on what buttons are pressed you would have 0 - 255 as the result (assuming none or all buttons are pressed etc) with Port_B0 = 1 and B7 = 128.

The layout being R2L facilitates this binary view being

B7 / B6 / B5 / B4 / B3 / B2 / B1 / B0
128 --------------------------------------1

However there is nothing to stop you using the custom pins function and assigning the first button to Port_B7 and the last to B0. This would then read on your chart L2R but of course your results would then have B7 = 1 and B0 = 128.

B0 / B1 / B2 / B3 / B4 / B5 / B6 / B7
128 -------------------------------------1

Therefore you would need to modify any calculations based on the returned value to suit. Easy enough if only using the result on the Switch component as you just assign the new values to position (e.g. position 1 now equals 128 instead of 1).

Hope this helps.

siliconchip
Posts: 47
Joined: Wed Dec 16, 2020 10:38 am
Has thanked: 18 times
Been thanked: 1 time

Re: Switch array

Post by siliconchip »

Hi
Thats basically what ive done but was hoping once they were selected to flip them around im sure this was possible in version 7
Cheers
Bob

medelec35
Valued Contributor
Posts: 2341
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 731 times
Been thanked: 789 times

Re: Switch array

Post by medelec35 »

Hi Bob.
If it something you really want, then I can explain step by step how to modify the switch array component to reverse switches so its left = port A 0 etc.
Martin

siliconchip
Posts: 47
Joined: Wed Dec 16, 2020 10:38 am
Has thanked: 18 times
Been thanked: 1 time

Re: Switch array

Post by siliconchip »

Hi martin
If you could that would be great

Cheers bob

medelec35
Valued Contributor
Posts: 2341
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 731 times
Been thanked: 789 times

Re: Switch array

Post by medelec35 »

Hi Bob.
I have noticed that the wiki source is out of date.
Therefore I have modified the latest version from a different source rather than explaining.
I would suggest adding the attached component to your own custom folder by following this wiki page

Note:
Instead of replacing, I have modified the switch array so you can still load the original switch array at the same time.

Can you please let me know how you get on.
Attachments
SwitchArraySlideReversed.fcpx
(8.37 KiB) Downloaded 4 times
Martin

medelec35
Valued Contributor
Posts: 2341
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 731 times
Been thanked: 789 times

Re: Switch array

Post by medelec35 »

I thought of way of adding an additional Normal/Reverse property to the switch array compomponent, if you are interested?
Martin

Post Reply