thank you it didn't appear for me
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.
I finally got the arrays to work correctly thank you very much.
However now I am in a new hole. When I try to transmit the array using the command
SEROUT2 PORTD.0, T1200, [STR htxt\StrLen,13,10]
it will not send any data out. I found out the 13,10 in the program command is related to the hyper terminal in the pc from what I understand. so I modified the program command to
SEROUT2 PORTD.0, T1200, [STR htxt\StrLen]
I am using a TX module that transmits any data that is transmitted to it serially it sends out wirelessly and the RX unit then serially transmit data to pic as you can see from the command I am using PORT D pin Zero at baud rate 1200 however I am confused as to why it is not receiving any of the data do I have to change anything on the receiving end to make it work? I have included both my transmitting and my receiving codes.
Bookmarks