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

20 lines
678 B
JavaScript

"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"));
var oled_font_5x7_1 = __importDefault(require("oled-font-5x7"));
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();
oled.setCursor(1, 1);
oled.writeString(oled_font_5x7_1["default"], 1, "This is a string I am writing to the screen", 1, true);
oled.turnOffDisplay();