Coder Social home page Coder Social logo

pixelbot's Introduction

What is this?

A small ruby web service for controlling NeoPixels attached to a RaspberryPi.

Is it any good?

Yes.

How do I run it?

Clone the repository to your RaspberryPi, and install all the dependencies:

git clone https://github.com/TwP/pixelbot.git
cd pixelbot
script/bootstrap

Open the pixelbot.yml file in your favorite editor and set the number of leds to the number of NeoPixels you have connected to your RaspberryPi. Set the gpio pin number to match the GPIO pin where the NeoPixels are connected to your RaspberryPi. Please read the RaspberryPi NeoPixel guide from Adafruit for all the details on setting up your NeoPixel circuit.

To start the web service run:

sudo script/pixelbot

Enjoy the blinkenlights!

It won't run!

Yes it will.

The ws2811 driver is using direct memory addressing (DMA) via /dev/mem to control the NeoPixels. Only the root user has permission to read and write to this hardware device. So any time your work with NeoPixels, your code will need to be run as the super user.

But I don't have a RaspberryPi

You're in luck!

When running on an architecture other than linux-arm (the RaspberryPi architecture), a fake LEDs class is used to simulate the NeoPixels. This set of fake LEDs is provided by the pixel_pi gem, and the fake LEDs are automatically used where needed.

The fake LEDs are displayed in the terminal using a UTF-8 fisheye "โ—‰" character, and the fake LEDs are colorized using the rainbow gem. So you can work with the LEDs even when a RaspberryPi is not handy.

pixelbot's People

Contributors

twp avatar

Stargazers

 avatar  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.