Help in using the key pad F/C V7 ?

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

Moderator: Benj

astro1234
Posts: 42
Joined: Mon Apr 10, 2017 12:53 pm
Has thanked: 36 times
Been thanked: 13 times
Contact:

Help in using the key pad F/C V7 ?

Postby astro1234 » Wed Apr 26, 2017 11:47 am

Hi i looking for some advice on using the key pad.
when i enter a key press, that number in binary is output to the leds.
what i need to learn is for example if i press the number three,just the third
led comes on in decimal, and not binary,can this be done using F/C V7 ?
Thanks for looking
Regards astro1234
Attachments
KEY_PAD_01.fcfx
(8.91 KiB) Downloaded 86 times

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

Re: Help in using the key pad F/C V7 ?

Postby Benj » Wed Apr 26, 2017 12:05 pm

Hello Astro1234,

Yes this should be easy enough. all you have to do is collect the number from the keypad and then shift 1 by the number.

output = 1 << number

You might have to subtract 1 from number otherwise this will light LED 1 when number is equal to 0, LED 4 when number is equal to 3.

for example in pseudocode

CompMacro number = Keypad::getNumber()
Decision number > 0
Yes: Calculation output = 1 << (number - 1)
No: Calculation output = 0

astro1234
Posts: 42
Joined: Mon Apr 10, 2017 12:53 pm
Has thanked: 36 times
Been thanked: 13 times
Contact:

Re: Help in using the key pad F/C V7 ?

Postby astro1234 » Wed Apr 26, 2017 12:27 pm

Benj wrote:Hello Astro1234,

Yes this should be easy enough. all you have to do is collect the number from the keypad and then shift 1 by the number.

output = 1 << number

You might have to subtract 1 from number otherwise this will light LED 1 when number is equal to 0, LED 4 when number is equal to 3.

for example in pseudocode

CompMacro number = Keypad::getNumber()
Decision number > 0
Yes: Calculation output = 1 << (number - 1)
No: Calculation output = 0


Thanks Benj for the reply, any chance of an example. so i now where i am going, have a lot to learn :D just started in using F/C V7.
big learning path for me.
Regards astro1234

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

Re: Help in using the key pad F/C V7 ?

Postby Benj » Wed Apr 26, 2017 1:05 pm

Here you go,

KEY_PAD_02.fcfx
(9.33 KiB) Downloaded 96 times

astro1234
Posts: 42
Joined: Mon Apr 10, 2017 12:53 pm
Has thanked: 36 times
Been thanked: 13 times
Contact:

Re: Help in using the key pad F/C V7 ?

Postby astro1234 » Wed Apr 26, 2017 1:17 pm

Benj wrote:Here you go,

KEY_PAD_02.fcfx


Thank you so much Benj for the file, thats a big help for me. :D
Regards astro1234.
These users thanked the author astro1234 for the post:
Benj (Wed Apr 26, 2017 2:16 pm)
Rating: 5.26%