Giter Site home page Giter Site logo

gnkarn / canvas-cast Goto Github PK

View Code? Open in Web Editor NEW

This project forked from owenmcateer/canvas-cast

0.0 2.0 0.0 12.81 MB

Cast any <canvas> element to an LED Matrix over WebSockets with an Arduino/ESP8266.

License: GNU General Public License v3.0

C++ 22.99% JavaScript 38.93% CSS 23.80% HTML 14.28%

canvas-cast's Introduction

Cast <canvas> to a Matrix

WebGL 3D

Cast any <canvas> element to an LED Matrix over WebSockets with an Arduino/ESP8266.

Bring your HTML canvas projects into the real world by streaming them in realtime over WiFi to an LED Matrix, using an Arduino compatable board with WiFi, such as the ESP8266..

Features:

  • Stream any canvas element over WiFi
  • Tested with 225 pixels at 60fps
  • 2D or 3D(WebGL)
  • Supports all popular LED types (powered by FastLED)
  • Matrix brightness control
  • Matrix status pixel
  • Web status/control

Status bar

More examples

Game of Life

Matrix rain - p5js

Webcam streaming - p5js

Getting started setup

In this example setup we're using:

  • ESP8266 NodeMCU
  • 15x15 RGB LED Matrix (WS2812B)
  • 5V 10A PSU
  • Laptop & home WiFi

Arduino/ESP8266

  1. Open the Arduino sketch file and edit the following settings:
// Wifi SSID and password
const char* ssid = "NetworkName";
const char* password = "wifipassword";
// Matrix size
const uint8_t kMatrixWidth = 15;
const uint8_t kMatrixHeight = 15;
// Matrix settings
#define LED_PIN 3
#define COLOR_ORDER GRB
#define CHIPSET WS2812B
  1. Upload sketch to the ESP8266.
  2. Open console monitor and take note of ESP8266's IP address. (or check your WiFi route)
  3. On the Matrix, pixel zero(status pixel) will flash orange while it connects to Wifi, once connected it will pluse green to indacate it is ready.

Web interface

  1. Open src/index.html and edit the following config, found at the top of the document. WS port will be 81 unless you changed it in the Arduino sketch.
// Config
const matrix = {
  // Matrix IP & port of ESP8266
  ip: '192.168.1.65:81',
  // Matrix pixel size
  width: 15,
  height: 15,
};
  1. Run the local development environment and check the status bar and Matrix status pixel.
    npm install
    npm run start
  2. See /examples for some simple examples.

canvas-cast's People

Contributors

owenmcateer avatar

Watchers

 avatar  avatar

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.