This is what I just started for a M5StickC:
require('Storage').write('.boot1',` global.M5C = { BTNA: D37, BTNB: D39, LED: D10, IR: D9, lcd: { // AXP192: { id: 0x34 }, LD02: power lcd, LD03: lcd on power: (state) => { M5C.lcd.flipBit(state, 2); }, backlight: (state) => { M5C.lcd.flipBit(state, 4); }, flipBit: (state, bit) => { I2C1.setup({ scl: D22, sda: D21 }); I2C1.writeTo(0x34, 0x12); buf = I2C1.readFrom(0x34, 0x12, 1)[0]; if (state) I2C1.writeTo(0x34, 0x12, buf | bit); else I2C1.writeTo(0x34, 0x12, buf & ~bit); } }, header: { Grove: [D32, D33], Front: [D26, D36, D0] } };`);
@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.
This is what I just started for a M5StickC: