Page 1 of 1

KEYPAD not work!

Posted: Sat Feb 04, 2023 12:58 am
by niedian
It works in simulation, but it doesn't work in practice.
KEDPAD.fcfx
(10.67 KiB) Downloaded 109 times

Re: KEYPAD not work!

Posted: Sat Feb 04, 2023 9:32 am
by chipfryer27
Hi

I notice in your chart that when writing to the LCD you are setting the cursor to 0,0 then printing. If you press the "#" key you will see "11" displayed correctly, but if you then press any key other than "# or *" you will display an incorrect value. For example if your press "#" then "11" is displayed but if you then press "2" you will see "21" displayed. This is because you are only overwriting the first digit (0,0) leaving the second digit intact. Instead of setting the cursor to 0,0 you could use the Clearline or Clear commands. Clearline can be set to 0,0 to only clear the first line whilst clear will clear the entire display.

Also, some older 16x2 displays need a delay from initialising to being used so it is a good idea to insert a 50mS delay after your LCD Start command.

I don't know what your exact problem is, as you haven't told us, but in future posts it would be better to be as specific as you can.

Without knowing anything further I would first try a "One-Second Flasher" to ensure your configuration is correct. See the WiKi here

https://www.flowcode.co.uk/wiki/index.p ... ED_flasher

If that is OK then I would try and identify which component, Keypad or Display isn't working.

After your lcd_Start command (and a delay of 50mS just to be safe) try printing a String such as "Hello World". If that doesn't work check display connections and again you will find details in the WiKi. Don't forget to connect "Contrast".

https://www.flowcode.co.uk/wiki/index.p ... hanumeric)

If you can tell us more details of what is not working, and things you have tried, we can probably help further.

Regards

Re: KEYPAD not work!

Posted: Sat Feb 04, 2023 2:08 pm
by medelec35
Hello.
Thank you for letting us know.
As a workaround, you can select the keypad on the 2D panel.
Right-click on it a select Replace
Choose the Keypad (Generic) then OK
Within the keypad properties, you will need to change Keys from 4 x 4 to 3 x 4 and select the correct port.
There is also an option to change what you see in the keys via ASCII within Return Values.
The Numeric Keypad will be looked into.

Re: KEYPAD not work!

Posted: Sun Feb 05, 2023 1:22 am
by niedian
Thank you very much! Solved!