4ib3r / node-epd

Nodejs library for Waveshare e-Paper modules
MIT License
31 stars 3 forks source link

Question:Library Usage #4

Open abhatikar opened 6 years ago

abhatikar commented 6 years ago

Hi,

I am trying to use the library for using the https://www.waveshare.com/wiki/2.7inch_e-Paper_HAT. I am using this with raspberry pi.I am successful in testing the demo code which is in python. I am to get this working with nodejs for which I found this library.Could you please help on how to use this library ? Any sample code ? I am also new to nodejs...

thanks in advance..

BenRoe commented 6 years ago

I have also problems with this library. I have a 2.9 e-Paper Display from Waveshare and it's connected to my RPI3

Paper HAT  wPi in script Raspberry Pi GPIO Pin
VCC 3.3V PIN 17
GND GND PIN 20
DIN PIN 19
CLK PIN 23
CS 10 PIN 24
DC 6 PIN 22
RST 0 PIN 11
LED 29 PIN 40
BUSY PIN 18

index.js

var Epd = require('bindings')('epd');
var lcd = new Epd(0, 4, 6, 10, 0, 29); //initialize display
lcd.clear(); //clear all lcd
lcd.rect(50, 8, 50, 50); //draw rect
lcd.update(function() { //update all display
  console.log("LCD updated");
  lcd.clearPart(); //switch to partitial update mode
  lcd.rect(100, 100, 20, 20); //draw rect
  lcd.line(100, 100, 120, 120); //draw line in rect
  lcd.partUpdate(); //update only changed part of display
});

I get the error Segmentation fault

Any ideas @4ib3r @paranic?

paranic commented 5 years ago

i usually get segmentation error when i try to print something on top of something else or print something out of bounds. watch closely what you print and in what position