KEYPAD not work!
-
- Posts: 105
- http://meble-kuchenne.info.pl
- Joined: Thu Jan 07, 2021 11:28 am
- Has thanked: 3 times
- Been thanked: 4 times
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: KEYPAD not work!
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
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
-
- Matrix Staff
- Posts: 1913
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 619 times
- Been thanked: 644 times
Re: KEYPAD not work!
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.
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.
Martin