sallar / rpi-matrix

A simple RaspberryPi clock and browser simulator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RaspberryPi LED Matrix Clock & Apps

This repo includes code for both RaspberryPi and it's web simulator. It's possible to design the code online before uploading to the Rpi.

⚠️ This project is one of my hobbies and it's not meant to be taken seriously or be used in production. It comes as is without any warranties. However I would appreciate your input and as always, PRs are very welcome.

Requirements

  • NodeJS
  • RasperryPi (Gen 1+, Zero, Zero W)
  • Wifi Adapter for Rpi (if not present on RaspberryPi itself or you are not using LAN)
  • Adafruit 32x16 RGB LED Matrix (or alike)
  • Jumper cables
  • Push Switch for changing modes

Wiring Up

Browser Simulation

To start the browser simulation of the physical device:

$ npm install
$ npm run dev

Deploy to the RaspberryPi

RPI_ADDRESS=192.168.11.5 npm run deploy

This command will build the project for use in Rpi device and deploys it to the device over the local network.

Creating Views

The app cycles through "views". Each view is a program that shows something on the LED. For example clock and bus are views. The user can toggle through views using the physical switch button. For creating a view, create a file in views folder. Each view should export these functions and properties:

  • setup() a function that returns a Promise. This function gets called once when the program starts.
  • teardown() a function that returns a Promise. This function gets called once when the program ends.
  • loop() Loop function gets called repeatedly at a rate that you specify with fps.
  • fps a properties that defines the rate at which the program calls loop function. Number of frames per second.

Related

License

This software is released under the MIT License

About

A simple RaspberryPi clock and browser simulator

License:MIT License


Languages

Language:TypeScript 89.0%Language:JavaScript 9.9%Language:Shell 1.1%