pixdisp/README.md

62 lines
3.3 KiB
Markdown
Raw Permalink Normal View History

[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)
[![Known Vulnerabilities](https://snyk.io/test/github/sexybiggetje/pixdisp/badge.svg?targetFile=package.json)](https://snyk.io/test/github/sexybiggetje/pixdisp?targetFile=package.json)
2018-01-04 23:37:36 +01:00
[![Maintainability](https://api.codeclimate.com/v1/badges/7178fe123a6aed4cd277/maintainability)](https://codeclimate.com/github/sexybiggetje/pixdisp/maintainability)
2018-01-05 19:54:21 +01:00
[![Test Coverage](https://api.codeclimate.com/v1/badges/7178fe123a6aed4cd277/test_coverage)](https://codeclimate.com/github/sexybiggetje/pixdisp/test_coverage)
2018-01-05 19:37:25 +01:00
[![Build Status](https://travis-ci.org/sexybiggetje/pixdisp.svg?branch=master)](https://travis-ci.org/sexybiggetje/pixdisp)
2018-01-04 23:25:51 +01:00
A small application to drive LED matrix displays, such as the [Pimoroni Unicorn](https://shop.pimoroni.com/?q=unicorn%20hat), from nodejs. My intention is to create a digital graffiti/guestbook system and a general animation system. This is a project for fun, so if you have a feature just request it! Or add it and I'll review it. Social coding ftw.
2017-12-12 20:41:32 +01:00
2018-01-04 23:25:51 +01:00
Make sure you are on a recent nodejs version. Raspbian has an old version. Use [Nodesource](https://github.com/nodesource/distributions) ;).
2018-12-03 02:03:21 +01:00
Also, use a decent modern browser. I wrote recent syntax, so probably works best in Chrome 62+. Firefox is known to have some issues, Edge works, Safari is a PITA. Just wait for your browser to play catch up then with recent standards. If you dislike Chrome, you can put this through Babel. But you're on your own there.
Copy config.example.json to config.json and pick a driver + display size.
execute:
2017-12-12 20:41:32 +01:00
npm install
nodejs pixdisp.js
2017-12-12 20:41:32 +01:00
2019-07-23 12:38:26 +02:00
optionally npm install pi-spi jpeg-js mjpeg-server
Navigate to http://localhost:8080/
2017-12-12 20:41:32 +01:00
2017-12-28 10:29:50 +01:00
Matrix driver & Unicorn Hat HD driver inspired by https://github.com/vesteraas/node-unicornhathd
JPEG encoding by https://github.com/eugeneware/jpeg-js
mjpeg-server by https://www.npmjs.com/package/mjpeg-server
### Unit tests
This application has some unit tests, making use of [Jest](http://facebook.github.io/jest/). Jest is configured as a dev dependency.
execute:
npm test
2018-01-07 09:48:51 +01:00
Some code linting practices and security tests can be executed by running the lint task:
npm run lint
2017-12-28 10:29:50 +01:00
### Drawing
![Device drawing](https://raw.githubusercontent.com/sexybiggetje/pixdisp/screenshots/device.jpg "Drawing on the device")
2017-12-28 10:41:31 +01:00
2018-12-03 02:03:21 +01:00
Simple clicking on the canvas in the responsive webinterface makes things light up; when you press submit it will get sent to the device.
2017-12-28 10:29:50 +01:00
### Camera
![Using your camera](https://raw.githubusercontent.com/sexybiggetje/pixdisp/screenshots/camera.jpg "Using your camera")
2017-12-28 10:41:31 +01:00
The webinterface allows you to capture your camera and submit images from there.
### Webinterface
![Web interface](https://raw.githubusercontent.com/sexybiggetje/pixdisp/screenshots/webui.png "Webinterface")
A simple web interface is included for drawing on the device. Defaults to port 8080.
### Coding
![Coding](https://raw.githubusercontent.com/sexybiggetje/pixdisp/screenshots/animation.jpg "Coding")
2018-01-10 20:10:01 +01:00
[![Demo](http://img.youtube.com/vi/4mPzOF_h1kQ/0.jpg)](http://www.youtube.com/watch?v=4mPzOF_h1kQ) (Click for youtube)
With an advanced editor you can write simple animations in the browser using a secure sandboxed javascript. Documentation will follow here once the API is final.