How can I use this include for something like this ???
Thanks !Code:main: @ READKEYPAD _myvar gosub check goto main check: select case myvar case 1 porta.0 = 1 ; WHILE CASE 1 PORTA.0 = 1, THEN PORTA.0 = 0
How can I use this include for something like this ???
Thanks !Code:main: @ READKEYPAD _myvar gosub check goto main check: select case myvar case 1 porta.0 = 1 ; WHILE CASE 1 PORTA.0 = 1, THEN PORTA.0 = 0
/Henrik.Code:CASE 1 Porta.0 = 1 WHILE myVar = 1 @ READKEYPAD _myvar WEND PortA.0 = 0
Thank You!
LE : But don't work.
Press button 1 of matrix ; led 1 = OFF ; end pressing button 1 ; led 1 = ON untill press ANOTHER button ...say button 2.
But pressing button 2 don't turn ON led2 ; just another press and release of button 2 turn correspondent led (2) ON.
Last edited by fratello; - 12th July 2015 at 18:39.
In your first post you indicated that you wanted PortA.0 high while the myVar was equal to 1 - is that not what's happening with the code?
How do you want it to work and what does the code look like?
Thanks for support , Mr.Henrik !
What I want :
- porta.x = ON while correspondent button.x is pressed.
How work :
- press button x ; do nothing ; release button x - porta.x=ON ; remain ON while press ANOTHER button(say y) ...But this new button(y) don't turn correspondent porta.y ON ; just turn OFF previous porta.x ; only after the release of the second press turn on correspondent porta.y...
Last edited by fratello; - 12th July 2015 at 19:20.
Hi,
1) The documentations for the keypad routine says that myVar should be a BYTE, you have it declared as a WORD. Don't think it matters but ....
2) There's no RETURN at the end of the Check subroutine.
3) The routine has some sort of AutoRepeat feature, I don't know if that is perhaps messing with you - I've never used the routine myself.
4) The filename for the INCLUDE file says Keypad1, have you modifed it in any way?
5) Do you have your LED's wired as in the schematic? Ie PortA.1 = 1 does actually turn on the LED?
Which device?
/Henrik.
1.I (re) declared myVar as byte .
2.I added Return at the end of check.
3.I use this in my keypad include :
" SINGLE_SCAN = 0 ; Scan ;till a key is pressed
KEYPAD_AUTOREPEAT = 1 "
4.No, just portb allocation
5.Yes.
No change in how the code work ...
Thanks again !
LE : "SINGLE_SCAN" must be set to "1" for acting like I wish ...
Thanks ! Regards !
Last edited by fratello; - 12th July 2015 at 20:15.
Bookmarks