Ok so I have started sifting through the code, the way I have it made no sense.
So here's my altered code:
Now what happens is :Code:'keypad capture code begins here myvar var byte [3] Pause 2000 ' Wait for LCD to startup start: 'mister_e's keypad code for counter = 0 to 3 if counter = 3 then lcdout "press # to send" @ READKEYPAD _myvar 'read keypress variable LOOKUP myvar,[0,"123A456B789C*0#D"],myvar 'use lookup table to diplay proper keypress 'datatx = myvar 'pass the variable to solve strange character problem lcdout myvar 'lcdout datatx 'lcdout "begin is ", dec myvar(0),dec myvar(1),dec myvar(2),dec myvar(3) 'display the variable on the LCD if myvar = "#" then goto TX if datatx = "*" then goto clearkeys pause 1000 ' Lcdout $fe,1 next counter goto start TX: hserout ["i got this string of numbers",$0d,$0a] hSEROUT ["Received:",STR myvar\3,$0d,$0a] 'HSEROUT ["1st digit ", dec myvar(0),$0d,$0a] 'HSEROUT ["2nd digit ", dec myvar(1), $0d,$0a] 'HSEROUT ["3rd digit ", dec myvar(2), $0d,$0a] 'HSEROUT ["B4 ", datatrx(3), $0d,$0a] 'HSEROUT ["B5 ", datatrx(4), $0d,$0a] goto clearkeys clearkeys: myvar = 0 goto start lcdout $fe,1 end
1.LCD shows the keypresses one after the next - spot on!
The main issue I have here is that each keypress from the keypad is not the actual numeric number , in other words 1 is ascii 1 and I want the actual number one decimal aka binary 00000001 and hex 01.
As a solution I thought of doing a table lookup and then conversion for example if i receive the ascii for the 1 button then I do a convert to actual numeric 1 decimal, is there a smipler method ?
Any tips, tricks,workarounds or solutions for this would be welcome.
2.The array myvar is set to [3] in the code. This is fine but the issue is that the * or # character are also included into the array and I only want numbers and possibly letter.
Is there some sort of filter or I could do and exclude them from the array?
Do I need a second array variable ?
3. Hserout is not sending the array values through. Maybe I have messed something up because in the MCS serial port tool all I see is
Any help, tips,tricks,code mods and snippets or suggestions would be greatly appreciated.Code:i got this string of numbers Received:#mi
Kind regards
Dennis


, Anyway after you

Bookmarks