Coder Social home page Coder Social logo

piglow's Introduction

PiGlow sample code and instructions

PiGlow is a small add on board for the Raspberry Pi that provides 18 individually controllable LEDs. You can use it for all sorts of things! And of course, it fits inside a Pibow!

Setting up your Raspberry Pi

PiGlow is based on an IC that communicates via i2c protocol. We need to enable i2c communication on your Raspberry Pi for it to work.

Enable the i2c driver modules by editing the modules config file:

sudo nano /etc/modules

Then either add or ensure the following lines are at the end of the file:

i2c-dev
i2c-bcm2708

You may also need to ensure the driver modules are not blacklisted by editing the blacklist config file:

sudo nano /etc/modprobe.d/raspi-blacklist.conf

Ensure that if the following two lines exist in that config file that you comment them out by adding a # sign at the start of the line. So:

blacklist spi-bcm2708
blacklist i2c-bcm2708

...should become...

# blacklist spi-bcm2708
# blacklist i2c-bcm2708

Then we install the i2c libraries and Python support:

sudo apt-get install python-smbus

Then reboot your Pi!

Running the example Python code

Either clone this git repository or download piglow-example.py. You can then run the sample by entering:

sudo python piglow-example.py

The Python code is designed to show you how to talk to the IC on the PiGlow board so that you can extend it to do other more exciting things!

Want a specific example of how to do something? Get in touch! We should be able to knock up an example or at least point you in the right direction. Just e-mail [email protected]

Other support for PiGlow

Gordon Henderson (@drogon on Twitter) has very kindly added support for PiGlow into his very popular wiringPi library and even includes a basic command line tool that you can use to control your PiGlow! http://wiringpi.com/dev-lib/piglow/

Simon Walters (@cymplecy) has added awesome PiGlow support to his Raspberry Pi GPIO Scratch library: http://cymplecy.wordpress.com/2013/08/12/scratch-gpio-piglow-support/

Jason Barnett has put together a great Python class and a load of samples: https://github.com/Boeeerb/PiGlow

Ben Lebherz has forked Jasons project and tidied up the code a bit while adding gamma correction: https://github.com/benleb/PyGlow

Manuel Ernst has created a Node.js library: https://github.com/zaphod1984/node-piglow

More information

For more information the datasheet for the SN3218 IC is included in this repository which outlines the complete communication protocol for the chip.

For those wanting to wire up their PiGlow in other ways these are the GPIO pins used by the module:

  • P1 & P17 (3V3)
  • P2 (5V)
  • P14 (GND)
  • P3 (SDA)
  • P5 (SCL)

piglow's People

Contributors

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