Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
Phil23 Guru Joined: 27/03/2016 Location: AustraliaPosts: 1667
Posted: 04:23am 20 Apr 2020
Copy link to clipboard
Print this post
Hi All,
Just began porting my Spa Controller code from a 28 Pin BackPack to an E100.
Step 1 was to comment out all the pin assignments to deal with later. Step 2 was to comment out the subs that relate to sensor etc referenced above.
I just want to see the screen layout at this stage & work on getting that modified for the bigger screen.
My plan was to just get the E100 running & move to GUI controls later
Ran the modified code & it appeared to run ok, given the screen placement needs updating.
Touched the screen to bring up the menu to change variables, that worked fine.
It uses @Geoffg 's parking meter code to draw the keyboard & enter variables. The keypad came up ok; scaled to the bigger screen & behaved as expected as I entered numbers.
But when I touch "Enter" to finish the entry it crashes out. The error message is contradictory. btn is a valid variable, VAR I assume so too & Val is valid as well.
[868] If btn = 16 And s <> "" Then VAR = Val(s) Error: Unknown command
Not sure which way to look next.
This is my modified version of @Geoffg 's original code, which is fine on the 28 pin backpack.
Line 868 in my real code translates to line 69 below.
Thanks
Phil.
Phil23 Guru Joined: 27/03/2016 Location: AustraliaPosts: 1667
Posted: 04:41am 20 Apr 2020
Copy link to clipboard
Print this post
Further more,
If I don't enter a value & just touch enter, it exits out as expected. That would give the case where s="" so the If condition would be false.
And the code below would not be executed.
Edit,
I should have said in the first post that when I touch a value to bring up the keypad to enter a number it works fine.
But then that line errors on touching the Enter on the keypad display. Entering numbers of cancelling works perfectly. Edited 2020-04-20 14:45 by Phil23
Phil23 Guru Joined: 27/03/2016 Location: AustraliaPosts: 1667
Posted: 04:54am 20 Apr 2020
Copy link to clipboard
Print this post
The only other thing that comes to mind is that maybe the firmware on the E100 (5.0501) is considering that line of code as illegal usage of the VAR Save/Restore/Clear command, where as the MMII firmware on the existing controller (5.02) is happy with VAR being a variable name.
Phil23 Guru Joined: 27/03/2016 Location: AustraliaPosts: 1667
Posted: 09:48am 20 Apr 2020
Copy link to clipboard
Print this post
Issue solved.
Turned to be related to the above post. Either the MM2 firmware or the older revision seems to be forgiving or the variable name VAR, where as 5.05 Plus firmware is not.
Interesting that the VAR command has been around forever, yet there are obviously firmware versions where that reserved word can be used as a variable name.
Both
And are both executed as valid on the MM+
yet it is only the line
that triggered an error.
Cheers
Phil
Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1646
Posted: 11:27pm 20 Apr 2020
Copy link to clipboard
Print this post
I think it was WhiteWizzard who had an issue with some Silicon Chip software that used SUB as a variable name which caused an error with a later version of MMBasic.