
Originally Posted by
Dennis
Thanks for the modification suggestion
Have tried the code as you have it posted
First issue was a compile error on this line
Code:
b0 = b0*10+_myvar ' add in the new number
So I changed it to read
Code:
b0 = b0*10+myvar ' add in the new number
and it compiled.
The resultant output in MCS serial tool each time on any keypress is 15 ??
At the moment I'm scanning through to see what else you modified and where the issue lies, will feedback if and when I find the problem :-)
Kind regards
Dennis
You may also need to check for the * and # conditions before you modify the B0 variable like this
Code:
@ READKEYPAD _myvar 'read keypress variable and place in myvar
if myvar < 10 then
b0 = b0*10+myvar ' add in the new number
else
if myvar = 12 then retry ' check for * condition
if myvar =13 then ' check for # condition
HSEROUT ["here is the total ",dec B0,$0d,$0a] 'send result to pc com port
A0=0
endif
endif
As you can see, I have used the raw values from readkeypad and you may need to change the 12 and 13 to whatever it is you get for * and #
Bookmarks