I'm surprised the IDE is getting stuck - but after power cycling the board it all works again until you re-flash the software?
I can see some potential issues here:
MDBT42 only has 40kB of flash memory available for writing, so if the file gets bigger than that storage.write will fail (however it should really give you an error message)
The code above needs two files, plus you need to store your code in flash, so realistically you're looking at an absolute maximum FILESIZE of 16kB
You're writing the temperature data with saveData 100 times per second (every 10ms). Did you intend to do it every 10 seconds instead? At 100 times per second you're going to fill up your log file in ~2 seconds
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi,
I'm surprised the IDE is getting stuck - but after power cycling the board it all works again until you re-flash the software?
I can see some potential issues here:
storage.write
will fail (however it should really give you an error message)saveData
100 times per second (every 10ms). Did you intend to do it every 10 seconds instead? At 100 times per second you're going to fill up your log file in ~2 seconds