1// { 2// "version": "1.0.0", 3// "io": { 4// "oled_dc": { 5// "type": "GPIO", 6// "port": 28, 7// "dir": "output", 8// "pull": "pulldown" 9// }, 10// "oled_res": { 11// "type": "GPIO", 12// "port": 30, 13// "dir": "output", 14// "pull": "pulldown" 15// }, 16// "oled_spi": { 17// "type": "SPI", 18// "port": 1, 19// "mode": "mode3", 20// "freq": 26000000 21// } 22// }, 23// "debugLevel": "DEBUG" 24// } 25 26import * as spi from 'spi' 27import * as gpio from 'gpio' 28import SH1106 from './sh1106.js' 29 30var oled_dc = gpio.open({ id: "oled_dc" }); 31var oled_res = gpio.open({ id: "oled_res" }); 32var oled_spi = spi.open({ id: "oled_spi" }); 33 34var dispaly = new SH1106(132, 64, oled_spi, oled_dc, oled_res, undefined) 35dispaly.open() 36 37var HAAS_XBM_width = 23 38var HAAS_XBM_height = 9 39 40var HAAS_XBM = [0xff, 0xff, 0xfe, 0x80, 0x00, 0x02, 0xa4, 0xc6, 0x7a, 0xa5, 0x29, 0x42, 0xbd, 0xef, 0x7a, 0xa5, 0x29, 0x0a, 0xa5, 0x29, 0x7a, 0x80, 0x00, 0x02, 0xff, 0xff, 0xfe] 41dispaly.draw_XBM(40, 20, HAAS_XBM_width, HAAS_XBM_height, HAAS_XBM) 42dispaly.show() 43