onInit will get called automatically, so no need to add E.on('init', function() { onInit(); });
onInit
E.on('init', function() { onInit(); });
Your main problem though is you're not initialising the oled display in onInit.
Try:
var g; function onInit() { I2C2.setup({scl:B10,sda:B3}); g = require("SSD1306").connect(I2C2, function() { oled(); }); }
@Gordon 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.
onInit
will get called automatically, so no need to addE.on('init', function() { onInit(); });
Your main problem though is you're not initialising the oled display in onInit.
Try: