EasyI2C is made for Singelboard Computers like BananaPi or RasberryPi. Supporting I2C-LCD; I2C-PN532 (RFID, NFC) [WIP]
Its a Wrapper! Using: i2c-bus
npm i easyi2c
https://www.npmjs.com/package/easyi2c
var EasyI2C = require("easyi2c");
var i2c = new EasyI2C(2);
i2c.on("connectedDevice", e => {
console.log(`${ e.fid} has connected to the I2C-Bus`);
});
i2c.on("disconnectedDevice", e => {
console.log(`${ e.fid} has has disconnected from the I2C-Bus`);
});
i2c.on("message", e => {
console.log(`${ e.fid} has send: ${ e.text} (${ e.bytes} Bytes)`);
});
i2c.on("ready", () => {
console.log("EasyI2C is ready!");
});
i2c.start();
i2c.on("connectedDevice", e => {
console.log(`${ e.fid} has connected to the I2C-Bus`);
if(e.fid =="0x27") {
lcd = i2c.LCD(e.id, 16,2);
lcd.print("Hello World");
}
});
lcd.print(String);
lcd.clear();
lcd.cursorFull();
lcd.cursorUnder();
lcd.setCursor(x:number,y:number);
lcd.home(); // => setCursor(0,0)
lcd.blink(boolen)
lcd.cursor(boolen);
lcd.setBacklight(boolen);
lcd.off();
lcd.on();
i2c.on(name, func);
i2c.LCD(address,cols,rows); //=> EasyLCD
i2c.start();
i2c.updateSpeed; // default 1000
i2c.devicelist;
i2c.devicelistjson(); get i2c.devicelist as json
i2c.write(address,String);
i2c.read(address,length); (length > response text)
i2c.sleep(ms);
i2c.request(address,text,length); // write + read (length > response text)
i2c.updateDeviceList(this) // dont use if you dont use i2c.start();
Using i2c-bus for communication