31 lines
673 B
TypeScript
31 lines
673 B
TypeScript
/*import { openSync } from 'i2c-bus';
|
|
import Oled from 'oled-i2c-bus';
|
|
import font from 'oled-font-5x7';*/
|
|
import { MenuConfig, MenuPrinter } from './interface';
|
|
|
|
/*const i2cbus = openSync(1);
|
|
const opts = {
|
|
width: 128,
|
|
height: 64,
|
|
address: 0x3C,
|
|
};
|
|
|
|
const oled = new Oled(i2cbus, opts);
|
|
|
|
oled.clearDisplay();
|
|
oled.setCursor(1, 1);
|
|
oled.writeString(font, 1, "This is a string I am writing to the screen", 1, true);
|
|
oled.turnOffDisplay();*/
|
|
|
|
export class OledPrinter implements MenuPrinter {
|
|
private _config: MenuConfig[];
|
|
|
|
constructor(config: MenuConfig[]) {
|
|
this._config = config;
|
|
}
|
|
|
|
public getSelection(): MenuConfig {
|
|
return this._config[0];
|
|
}
|
|
}
|