Page 1 of 1
Switch array
Posted: Fri Aug 07, 2026 8:22 pm
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
Re: Switch array
Posted: Sat Aug 08, 2026 9:16 am
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.
Re: Switch array
Posted: Sat Aug 08, 2026 9:55 am
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
Re: Switch array
Posted: Sat Aug 08, 2026 12:43 pm
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.
Re: Switch array
Posted: Sat Aug 08, 2026 1:07 pm
by siliconchip
Hi martin
If you could that would be great
Cheers bob
Re: Switch array
Posted: Sat Aug 08, 2026 9:19 pm
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.
Re: Switch array
Posted: Sat Aug 08, 2026 9:54 pm
by medelec35
I thought of way of adding an additional Normal/Reverse property to the switch array compomponent, if you are interested?