At least I'm not alone then :-)
I'm sure it has to do with passing the variable 'cos a 'string like this' appears just fine !
And if I LCDOUT myvar that works fine on the LCD
What doesn't work fine is when I SEROUT the variable myvar and try read it in hyperterminal
WEIRD or what ?
In fact with SEROUT using N2400 the output is worse and even the string of text is wingings :-)
See next post here for the output screenshot... this tells me that T2400 is correct !
Last edited by Dennis; - 22nd November 2009 at 00:25.
See the Received window
WOOHOO!
Well, I do have 4 eyes, so I guess you can have a couple of them.dude can I borrow those 'fine-tooth comb code-eyes' ???
Need a new pair of specs anyhow.
For the SEROUT prob...
Steve's keypad routine returns a result that represents the number of the key. For a 4x4 pad it's 1-16.
With a LOOKUP statement you can change them to match your keypad ...hthm,Code:LOOKUP myvar,[0,"123A456B789C*0#D"],myvar
DT
Darrel
.'
?Is Steve mister e ??
Code-wise I tried , Bruce's code and Trent Jackson's code ....
Mister e's is what I'm using at the moment, it was the one that worked for me, but the other would probably work now that the LCD problem is cleared up ;-) ...
Where is the keypad code you are referring to ? I am willing to give it a bash :-)
Kind regards
Dennis
Oh and I sure did get my fair share of moving wires and resistors around to get the correct column and row assingments ;-)
Roll on virtual ports hey ?
Last edited by Dennis; - 22nd November 2009 at 01:09.
Yup, Steve is mister-e.
By changing from key numbers to ASCII with the Lookup, your serout should work better.
<br>
DT
Darrel :-)
So with 8 sets of eyes in total now... should I add the LOOKUP prior to making the assembly key lookup like this ?
Kind regardsCode:start: 'read keypress variable @ READKEYPAD _myvar LOOKUP myvar,[0,"123A456B789C*0#D"],myvar 'lcdout $fe, 1 'clear lcd screen 'pause 2000 lcdout dec myvar 'display keypress variable myvar 'transmit section SerOut PORTC.6,T2400,["the key pressed is",myvar] 'SerOut PinNumber2,T2400,DataRec pause 1000 'transmit section ends 'receive section 'SerIn PORTC.7,T2400,DataRX 'LCDOUT datarx 'displays data received from serin datarx 'receive section ends lcdout $fe,1 'clear lcd screen goto start
Dennis
@ READKEYPAD _myvar
Except for the DEC modifier, good to go.
Code:start: 'read keypress variable @ READKEYPAD _myvar LOOKUP myvar,[0,"123A456B789C*0#D"],myvar 'lcdout $fe, 1 'clear lcd screen 'pause 2000 lcdout <strike>dec</strike> myvar 'display keypress variable myvar 'transmit section SerOut PORTC.6,T2400,["the key pressed is",myvar] 'SerOut PinNumber2,T2400,DataRec pause 1000 'transmit section ends 'receive section 'SerIn PORTC.7,T2400,DataRX 'LCDOUT datarx 'displays data received from serin datarx 'receive section ends lcdout $fe,1 'clear lcd screen goto start
DT
Bookmarks