This repository has been archived on 2022-12-29. You can view files and clone it, but cannot push or open issues or pull requests.
zeropod/bin/main.js

19 lines
655 B
JavaScript
Raw Normal View History

2022-04-19 17:31:08 -05:00
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
exports.__esModule = true;
var i2c_bus_1 = require("i2c-bus");
var oled_i2c_bus_1 = __importDefault(require("oled-i2c-bus"));
2022-04-19 17:39:44 -05:00
var oled_font_5x7_1 = __importDefault(require("oled-font-5x7"));
2022-04-19 17:31:08 -05:00
var i2cbus = (0, i2c_bus_1.openSync)(1);
var opts = {
width: 128,
height: 64,
address: 0x3C
};
var oled = new oled_i2c_bus_1["default"](i2cbus, opts);
oled.clearDisplay();
2022-04-19 17:39:44 -05:00
oled.setCursor(1, 1);
oled.writeString(oled_font_5x7_1["default"], 1, "This is a string I am writing to the screen", 1, true);