You have only declared "rbuf var byte" It is being used as a pointer as far as I can see. It will be NO LARGER than 255.
You have only declared "rbuf var byte" It is being used as a pointer as far as I can see. It will be NO LARGER than 255.
Dave Purola,
N8NTA
EN82fn
Hi dave,
i solved it.
i used the rbuf as var word
Then i didnt add the commands for
i used the above command only to combine it with the following and present the number to the lcd.Code:arraywrite rbuf,[dec speed1,dec2 speed2,0]
So the solutions for me is:
Thanks a lot for the help all of you.Code:checkt: RBUF = (SPEED1*100) + SPEED2 IF RBUF > 5682 THEN ; THIS IS JUST AN EXAMPLE GOSUB LIMIT RETURN
Last edited by astanapane; - 4th September 2020 at 18:23.
additional missing line from the previous message
i used the above command only to combine it with the following and present the number to the lcd.Code:arraywrite rbuf,[dec speed1,dec2 speed2,0]
in any case the solution is to use the rbuf as word, multiply by 100 the speed1 and add speed2.Code:LCDSTR x,y, rbuf
has not solved it at all , you cannot safely use arraywrite rbuf,[dec speed1,dec2 speed2,0] with a word var as the destinationi solved it.
i used the rbuf as var word
the destination for the text chrs generated by arraywrite must be an existing chr array big enough to contain the text generated plus a null terminator
not doing so will lead to enormous problems
secondy to expect the result of arraywrite to be usable as a number is absurd , its a textual chr string
Warning I'm not a teacher
there is a missandestanding. my fault because i consfused you by using the same name for the variable SBUF and RBUF in the previous posts.
vars.....
SBUF var byte
RBUF var word
Program in the main loop includes the command:
then there is a checkSpeed LABELCode:arraywrite SBUF, [dec speed1, dec2 speed2,0] ;
checkSpeed:
And that is what it works for me. It is under testing for a day now, and havent seen any strange behaviour.Code:RBUF = (speed1*100) + speed2 if RBUF > 5687 then; just an example gosub limit endif return
thanks.
SBUF var byte
sadly still woefully incorrect.
that reserves 1 byte , you need at least 5 bytes
Warning I'm not a teacher
Bookmarks