• onInit will get called automatically, so no need to add 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();
      });
    }
    
About

Avatar for Gordon @Gordon started