Well Richard, Making the statement LOOKUP2 does not seem to work. I have no idea where the data is coming from but, it is not what I set the ARRAYWRITE statement with. The only thing that is correct as I can see it is the string length.
Well Richard, Making the statement LOOKUP2 does not seem to work. I have no idea where the data is coming from but, it is not what I set the ARRAYWRITE statement with. The only thing that is correct as I can see it is the string length.
Dave Purola,
N8NTA
EN82fn
your correct dave , I have fallen into a trap set by mike, a sram array is not a valid source for any pbp lookup command . the concept seems flawed anyway surely the lookup table source should be the translated data table and the outarray data the index. we already have b0 as a pointer to the outarray data .
my intent was just to demonstrate how to cycle through an array of variable length using a null as the end marker
Warning I'm not a teacher
Retypesnikrep, what are you wanting to display? Is there constants like "Temperature is " along with variables like "TempC VAR BYTE"? I've used the HD44780 based LCD for several projects. A display line would look like:
Here I use ARRAYWRITE to extract the individual digits of my pressure value LPsi into ARRAY LPsiA in ASCii format.Code:ARRAYWRITE LPsiA, [#LPsi] for b0 = 0 to 13 LOOKUP b0,["Low PSI Set = "],b1 PORTB = b1 gosub Send next b0 if LPsi < 10 then LPsiA[1] = LPsiA[0] LPsiA[0] = " " endif PORTB = LPsiA[0] gosub Send PORTB = LPsiA[1] gosub Send
I use LOOKUP to extract individual characters from the string "Low PSI Set = ".
basically I have a 1ms interrupt going on.
I want this to check a buffer for stuff waiting to be sent to the screen, and if stuff waiting then send it via Hserout one chr at a time.
OK so far.
I want to fill my large buffer using array write as it contains text and variables... ie
So it mimics the screen, as if I was writing it straight to the screen using hserout....
arraywrite buffer, ["Temperature 1 is ",#Temp1,"C",32,"Temperature 1 is ",#Temp1,"C"]
Thanks Richard, I do understand now. By the way, What's Mpgmike and Retepsniarep talking about? It seems as though this tread has been hijacked.
Dave Purola,
N8NTA
EN82fn
Richard, After chatting with Charles, I decided to eliminate the "lookup2" statement and just pass the array variable to the serial buffer routine. All is working now. Nice and neat. Here is the code:
'************************************************* ********************
SERIALOUT2: 'OUTPUT SERIAL STRING TO PORT 2
'************************************************* ********************
BYTEIN = 0
WHILE OUTARRAY(BYTEIN)
TX_BYTES2(TX_OUTPUT2) = OUTARRAY(BYTEIN)
BYTEIN = BYTEIN + 1
GOSUB SNDCHAR2 'INCREMENT BUFFER POINTERS
WEND
RETURN
Dave Purola,
N8NTA
EN82fn
Bookmarks