Suggested improvement to Flowcode

For C and ASSEMBLY users to post questions and code snippets for programming in C and ASSEMBLY. And for any other C or ASM course related questions.

Moderators: Benj, Mods

Post Reply
billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Suggested improvement to Flowcode

Post by billduck »

I am using 4 push-buttons on a project. If I use a switch-bank, I can simulate, through key mappings, from the laptop keyboard. For example, I can assign keys 0,1,2,3 to simulate Port B,bit's 0,1,2,3. Works fine for simulation. But, on the board I am using from Bipom, the only port that has 4 bits is C and 2 of these bits are reserved for I2C. So I tried 4 separate push-buttons. It works when running the program on the board, but I can not simulate, because the key mappings only have one option-1,1,1,1. It would be useful, if I were given options for key mappings, when using 4 distinct push buttons.
Thanks in advance.

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Suggested improvement to Flowcode

Post by Steve »

This should work ok. I've just tested here and I can add 4 separate switches to the panel and use key-mapping to assign them each to a separate key on the keypad.

billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Re: Suggested improvement to Flowcode

Post by billduck »

Odd. I am using version 4.3.6.6.1. I am only given the option of "0" for each of the 4 separate switches. What am I missing?
Attachments
FlowcodeSwitches.png
(83.22 KiB) Downloaded 3198 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Suggested improvement to Flowcode

Post by medelec35 »

billduck wrote: I am only given the option of "0" for each of the 4 separate switches.
I believe Bill is correct. Appears the same with Flowcode for pic. Only way so far I assign separate e.g 4 switches , with separate numbers is to use multiple switch banks, not separate switches.
This is not ideal if you want some switches as latch and some as push to make, some as .
At present if you want two toggle and two push to make, you will need a bank of two, then a bank of 4.
Unless I have missed what Steve has spotted of course. (not difficult for me :P )
Perhaps as a further suggestion, you could have the option of pressing any key on the keyboard, and that key is assigned to an individual switch.
So switch can be assigned with a letter or a number.
Martin

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Suggested improvement to Flowcode

Post by Steve »

The "element" item is used to identify multiple inputs in an object which has more than one control - e.g. the switch bank and the keypad.

There should be no problem adding two switches to the panel, connecting them to different pins and ports, and assigning them to different keys on the keypad.

So in the screenshot, you could see KEY 0 assigned to element 0 of SWITCH(0) and KEY 1 assigned to element 0 of SWITCH(1). This would allow the independent operation of 2 separate switches using different keys.

Or have I got the wrong end of the stick??

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Suggested improvement to Flowcode

Post by medelec35 »

Steve wrote:
There should be no problem adding two switches to the panel, connecting them to different pins and ports, and assigning them to different keys on the keypad.
Ahh of course. You are correct Steve. You can assign individual switches to the keys. It is me that has got it wrong.
Sorry.
Martin

billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Re: Suggested improvement to Flowcode

Post by billduck »

So I am not clear how to assign an individual switch to a keypad number. The element column shows "0" on all switches. It is the only option.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Suggested improvement to Flowcode

Post by medelec35 »

Hiya billduck.
On the key component mappings there are three headings:
Key: Component: Element:

The key you want to activate the switch is the Key: heading (not the element). On image you posted you have selected key 1 on your keyboard/keypad , as all other keys have words none, the element of active switch will always be 0 this 0 does not reflect any key number.

So if you want another key e.g key 5 on your keyboard to operate another switch e.g SWITCH(2). Then next to key: 5 (6th one down the list)
Change 'None' to 'SWITCH(2)' and select '0' for the element.
Martin

billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Re: Suggested improvement to Flowcode

Post by billduck »

Thanks. Too simple! Where is the ata'boy button?

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Suggested improvement to Flowcode

Post by medelec35 »

billduck wrote:Thanks. Too simple! !!)?
Actually it only seems simple when feature is explained!
Believe me it has caught other people out before (myself included!!)?
billduck wrote:Where is the ata'boy button?
That's the thumbs up icon :P
Martin

Post Reply