I like to save code to Storage and than require it, this save a big amount of vars.
Tested with tinyMQTT and a strip down of SSD1306 for I2C only (SSD1306_I2C).
snippet how to store it
s = require('Storage'); // min of SSD1306_I2C saved as SSD1306S s.write('SSD1306S',"function k(b){.......}";
snippet to use it
I2C1.setup({sda:D2,scl:D4, bitrate:200000}); oled = require("SSD1306S").connect(I2C1,........);
@MaBe started
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.
I like to save code to Storage and than require it, this save a big amount of vars.
Tested with tinyMQTT and a strip down of SSD1306 for I2C only (SSD1306_I2C).
snippet how to store it
snippet to use it