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
Help in using the key pad F/C V7 ?
Moderator: Benj
Help in using the key pad F/C V7 ?
 Attachments

 KEY_PAD_01.fcfx
 (8.91 KiB) Downloaded 103 times
Re: Help in using the key pad F/C V7 ?
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
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
Regards Ben Rowland  MatrixTSL
Flowcode Product Page  Flowcode Help Wiki  Flowcode Examples  Flowcode Blog  Flowcode Course  My YouTube Channel
Flowcode Product Page  Flowcode Help Wiki  Flowcode Examples  Flowcode Blog  Flowcode Course  My YouTube Channel
Re: Help in using the key pad F/C V7 ?
Thanks Benj for the reply, any chance of an example. so i now where i am going, have a lot to learn just started in using F/C V7.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
big learning path for me.
Regards astro1234
Re: Help in using the key pad F/C V7 ?
Here you go,
Regards Ben Rowland  MatrixTSL
Flowcode Product Page  Flowcode Help Wiki  Flowcode Examples  Flowcode Blog  Flowcode Course  My YouTube Channel
Flowcode Product Page  Flowcode Help Wiki  Flowcode Examples  Flowcode Blog  Flowcode Course  My YouTube Channel
Re: Help in using the key pad F/C V7 ?
Thank you so much Benj for the file, thats a big help for me.Benj wrote:Here you go,
Regards astro1234.