Page 1 of 1

Printing a space bar using a keypad

Posted: Sun Mar 04, 2018 11:45 am
by Jacob1
Hi All,

I am having difficulty with printing a space when the * button is pressed. I have seen other members ask this question and I have had a look at other peoples keypad programs. I have tried using 32, as the keypad number, which in theory should be printed as the ASCII equivalent which is a space.
My program uses a number which is multiplied by 10 and then added to the key pressed, so it can be displayed one after the other. I have got very close with this problem, as I have now managed to print a number one after the previous by pressing *, but it stays at 32 instead of going to the space icon.

E.g I want to input numbers like 0123 and then when * is pressed the next number will go after with a space so, if I pressed 6 after it would be 0123 6 on the LCD

I have attached my program, I think the problem may lie with the program afterwards which then converts my number variable into a string. If anyone knows how to print a space bar using *, then I would appreciate your help,
Kind Regards,
Jaco

Re: Printing a space bar using a keypad

Posted: Sun Mar 04, 2018 5:38 pm
by Jacob1
Hi everyone,

Just thought I would let you know I have now solved this issue! :D By changing my program extensively to not using strings and instead using a variable for the cursor x which is incremented. For the space to show, I used print string and then just " ", should have thought of this before!

I've attached the program below, as reference for anyone in the future who has the same issue :)

All the best,
Jacob