Git Product home page Git Product logo

inkyphat-node's People

Contributors

dependabot[bot] avatar pbertie avatar steveedson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

steveedson

inkyphat-node's Issues

Does this work at all with InkypHAT Black/White?

I've been trying to get this to work on my inkypHAT black/White and all the examples just draw a solid rectangle about 80% of the screen and nothing more or less. What could I be doing wrong? code below

const inkyphat = require('inkyphat')();

async function main() {

  await inkyphat.init();

  // inkyphat.setPixel(1, 5, inkyphat.RED);

  inkyphat.drawRect(50, 100, inkyphat.BLACK);
  // inkyphat.drawRect(150, 20, 210, 60, inkyphat.BLACK);

  await inkyphat.redraw();

  await inkyphat.destroy();
}
main();



Also is there any movement on making text work with this?

Error during install on a Pi Zero W

[email protected] install /home/pi/Tools/instrument.local/node_modules/inkyphat/node_modules/pi-spi
> node-gyp rebuild

/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:304:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:12)
gyp ERR! System Linux 4.14.34+
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/Tools/instrument.local/node_modules/inkyphat/node_modules/pi-spi
gyp ERR! node -v v4.8.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
 

> [email protected] install /home/pi/Tools/instrument.local/node_modules/inkyphat/node_modules/onoff/node_modules/epoll
> node-gyp rebuild


Traceback (most recent call last):
  File "/usr/share/node-gyp/gyp/gyp_main.py", line 9, in <module>
    load_entry_point('gyp==0.1', 'console_scripts', 'gyp')()
  File "/usr/lib/python2.7/dist-packages/gyp/__init__.py", line 545, in script_main
    return main(sys.argv[1:])
  File "/usr/lib/python2.7/dist-packages/gyp/__init__.py", line 538, in main
    return gyp_main(args)
  File "/usr/lib/python2.7/dist-packages/gyp/__init__.py", line 502, in gyp_main
    'cwd': os.getcwd(),
OSError: [Errno 2] No such file or directory
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:304:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:12)
gyp ERR! System Linux 4.14.34+
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/Tools/instrument.local/node_modules/inkyphat/node_modules/onoff/node_modules/epoll
gyp ERR! node -v v4.8.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the pi-spi package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls pi-spi
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.14.34+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "inkyphat"
npm ERR! cwd /home/pi/Tools/instrument.local
npm ERR! node -v v4.8.2
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
 
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/Tools/instrument.local/npm-debug.log
npm ERR! not ok code 0

Enanchements

Hi! I find this application very interesting and I need your help to enananche it!

  1. What type of changes are needed to use with other inky_phat colors (like YELLOW version)?
  2. It is possible to write some text using this library?

Timeout Error with Example code

When I run the following example code I get the below error:
I have no idea what is causing this can you possible help?

Code:

const inkyphat = require('inkyphat')();
async function main() {
  await inkyphat.init();
  inkyphat.setPixel(1, 5, inkyphat.RED);
  inkyphat.drawRect(50, 100, inkyphat.BLACK);
  await inkyphat.redraw();
  await inkyphat.destroy();
}
main();

Output:

Error: Timeout
at Timeout._onTimeout (/home/pi/mqtt/node_modules/inkyphat/lib/inkyphat-utils.js:14:12)
at listOnTimeout (internal/timers.js:555:17)
at processTimers (internal/timers.js:498:7)
(node:2400) UnhandledPromiseRejectionWarning: Error: Timeout
at Timeout._onTimeout (/home/pi/mqtt/node_modules/inkyphat/lib/inkyphat-utils.js:14:12)
at listOnTimeout (internal/timers.js:555:17)
at processTimers (internal/timers.js:498:7)
(Use node --trace-warnings ... to show where the warning was created)
(node:2400) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:2400) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.