- Sat Feb 04, 2017 5:12 am
#62008
If reflash to 1Mb cured long-lasting 4Mb problems then common-sense logic says it was due either to previous corruption or lack of memory. Or perhaps there's been something else relevent that has not been noticed. One thing to be aware of is that if a different program gets loaded you are still only going to see the original if you browser back to the Edit window - you then need to click the Edit button to load the ESP's new script into the browser Edit window... which is something easily missed by anyone not looking.
But whatever your problems have been, I've included a pair of programs that are definitely working for me on both 1Mb and 4Mb builds... and I've included a 'tell-tale' so you'll know for sure if it's working for you.
*EDIT*
Yeah, lack of memory shouldn't be your problem. But bear in mind that unless you include a 'memclear' instruction in the loaded program(s), all previous variables will still exist and accululate - which besides eating up memory, can cause interpreter confusion from similarly named branches and vars. I don't know if the same applies to previous 'wait' type interrupt driven declarations such as timer etc, but it's an obvious likely cause of problems if so.
Interpreter problems typically cause a crash and reboot, and once things start getting out of control like that, don't be surprised if it results in a corrupted interpreter.
Code: Select all'/default.bas
memclear
button "Load Toggle", [Toggle]
wait
[Toggle]
load "/toggle.bas"
wait
Code: Select all'/toggle.bas
cls
print "toggle.bas is loaded and running *** Note: browser back then click Edit button to display it in browser ***"
led_pin = 16
led_state = 1
timer 500, [toggle_led]
wait
[toggle_led]
if led_state = 1 then led_state = 0 else led_state = 1
io(po, led_pin, led_state)
wait
Last edited by Electroguard on Sat Feb 04, 2017 7:27 am, edited 2 times in total.