In the program when i do
lcdout #key it shoots out the key correctly on the lcd however
when i use
htxt(x) = #key
it says bad expression when i try to compile
also when i use
htxt(x) = key
it works fine however it displays a blank spot on the lcd
In the program when i do
lcdout #key it shoots out the key correctly on the lcd however
when i use
htxt(x) = #key
it says bad expression when i try to compile
also when i use
htxt(x) = key
it works fine however it displays a blank spot on the lcd
htxt(x) = key ------>>>>> lookup key , [ "0123456789ABCDEF" ] , htxt[x]
^get rid of^---------------^^^^^^ replace with ^^^^^^^^^^^
Your turn to figure out why assigning the variable 'key' to htxt(x) and trying to get the LCD to display what is effectively variable 'key' doesn't work.
What is the ASCII character equivalent to 'key', if 'key' = 1? if 'key' = 2? if 'key' = 65?
Last edited by skimask; - 3rd July 2007 at 03:08.
i see ill try thank you for the reply. If you don't mind could you give me an example of that a very simple version of it that I could run with. Im sorry for being so ignorant but arrays is brand spanking new to me.
I can do that quite effectively ahaha its this damn blasted arrays thats slowing me down I have entire codes already done for that portion its just that I want to be able to loop the message over and over but I need arrays to do that and the message is not predetermined it will be different depending on the user.Your turn to figure out why assigning the variable 'key' to htxt(x) and trying to get the LCD to display what is effectively variable 'key' doesn't work.
What is the ASCII character equivalent to 'key', if 'key' = 1? if 'key' = 2? if 'key' = 65?
Last edited by MrSafe; - 3rd July 2007 at 03:14.
The code below will compile all I did different from the code on the bottom is change the htxt[x] to x
alpha1:
gosub getkey
LOOKUP key,[" ABCDEFGHIJ"],x
htxt[x] = htxt[x] + 1
RETURN
The code above will not compile the compiler gives me the fallowing erroralpha2:
gosub getkey
LOOKUP key,[" KLMNOPQRST"],htxt[X]
htxt[x] = htxt[x] + 1
RETURN
"output parameter must be a variable"
The answer is in the manual under the specifications for the LOOKUP...
Array variables with a variable index (ex. htxt[x] ) may not be used in LOOKUP although array variables with a constant index (ex. htxt[1] ) are allowed
So, don't use what doesn't work, and use what does work and change it around a bit...
Code:alpha2: gosub getkey LOOKUP key,[" KLMNOPQRST"],tempx htxt[x] = tempx htxt[x] = htxt[x] + 1 RETURN
Last edited by skimask; - 3rd July 2007 at 06:13.
I Got the code to work with each part. By that I specifically mean
They work by them selfs however when I combine all of them like in the code provided they do not work I have tried everything I could think of any suggestions?alpha1:
gosub getkey
LOOKUP key,[" ABCDEFGHIJ"],Char
if (key = 1) Then char = "A"
if (key = 2) Then char = "B"
if (key = 3) Then char = "C"
if (key = 4) Then char = "D"
if (key = 5) Then char = "E"
if (key = 6) Then char = "F"
if (key = 7) Then char = "G"
if (key = 8) Then char = "H"
if (key = 9) Then char = "I"
if (key = 0) Then char = "J"
RETURN
**UPDATE**
What I want my program to do after he or she has chosen to type their message in is I want it to store every character and number that they type in and display it on the lcd. What I thought would be the best method to do this is to use an array to store the message keystroke by keystroke and display it as he or she is typing the message after which to send the stored data out one byte at a time to the destination I am transferring the data wireless over the air.
Last edited by MrSafe; - 3rd July 2007 at 07:10.
Bookmarks