Git Product home page Git Product logo

programmable-christmas-star's Introduction

Programmable Christmas Tree Star

banner

Bring some Raspberry Pi based festive cheer to your Christmas this year with the ModMyPi Christmas Star and bring your tree to life!

What's in this repository

This repository should be used by cloning the repo first using

git clone https://github.com/modmypi/Programmable-Christmas-Star

Which will give you a copy locally.

Inside there is a script called star.py which contains a GPIO Zero compatible code allowing you to simply create and use the Star with only a couple of lines of Python.

To switch on the Star you can use:

from star import Star

star = Star()

star.on()

There are several example files to shouw you what can be done with the star:

Example files

  • all_on.py - turns on all of the LEDs.
  • in_out.py - blinks the inner and outer ring of LEDs alternately.
  • random_leds.py - turns on and off all the LEDs
  • slow_walk.py - slowly walks around the LEDs increasing pace until they can't go any faster.
  • twinkle.py - a pulsing walking pattern around the LEDs.

These files can all be run using: sudo python3 name_of_example.py

Star Commander

You can follow the tutorial on our website and learn how to use the Star Commander script.

This script allows you to command how the start glows from the command line over SSH. There are 4 built in modes (plus an off switch) to control the star with ease without having to climb the tree and attach a monitor each time.

Let us know how you get on with the Star and we hope you have a Merry Christmas.

programmable-christmas-star's People

Contributors

tuftii avatar

Stargazers

 avatar Will Abson avatar Casey LP avatar  avatar  avatar Alasdair Lomas avatar Josh Davis avatar Ian Mascarenhas avatar Phil Lang avatar Daniel P avatar Michael Biel avatar

Watchers

James Cloos avatar  avatar

programmable-christmas-star's Issues

LED always off

Hello,

Does someone know the reference of LEDs used to make the star ? One on my Star is dead, I'd like to replace it if possible.

Here is the all_on.py example :
PXL_20231219_171317185

Thanks

Scripts fail with Python 3.7 and gpiozero 1.5.1

Hi,

I was just giving the christmas star a spin and am running into several issues.

Only all_on.py works but throws alot of errors.
The other scripts in_out.py, random_leds.py, slow_walk.py, starcommander.py and twinkle.py exit out fast and have no effect on the LEDs.

I have Python 3.7 installed.
The gpiozero package installed via pip3.

pip3 show gpiozero
Name: gpiozero
Version: 1.5.1
Summary: A simple interface to GPIO devices with Raspberry Pi.
Home-page: https://github.com/RPi-Distro/python-gpiozero
Author: Ben Nuttall
Author-email: [email protected]
License: BSD License
Location: /usr/local/lib/python3.7/dist-packages
Requires: colorzero

Taking twinkle.py for example.

python3 twinkle.py
/usr/local/lib/python3.7/dist-packages/gpiozero/devices.py:279: PinFactoryFallback: Falling back from rpigpio: No module named 'RPi'
'Falling back from %s: %s' % (name, str(e))))
/usr/local/lib/python3.7/dist-packages/gpiozero/devices.py:279: PinFactoryFallback: Falling back from rpio: No module named 'RPIO'
'Falling back from %s: %s' % (name, str(e))))
/usr/local/lib/python3.7/dist-packages/gpiozero/devices.py:279: PinFactoryFallback: Falling back from pigpio: No module named 'pigpio'
'Falling back from %s: %s' % (name, str(e))))
Traceback (most recent call last):
File "twinkle.py", line 4, in
star = Star(pwm=True)
File "/usr/local/lib/python3.7/dist-packages/gpiozero/devices.py", line 124, in call self = super(GPIOMeta, cls).call(*args, **kwargs)
File "/home/pi/Programmable-Christmas-Star/star.py", line 16, in init pin_factory=pin_factory),
File "/usr/local/lib/python3.7/dist-packages/gpiozero/devices.py", line 124, in __call__self = super(GPIOMeta, cls).call(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/gpiozero/boards.py", line 415, in init super(LEDBoard, self).init(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/gpiozero/boards.py", line 335, in init
for name, pin_or_collection in kwargs.items()
File "/usr/local/lib/python3.7/dist-packages/gpiozero/boards.py", line 335, in for name, pin_or_collection in kwargs.items()
File "/usr/local/lib/python3.7/dist-packages/gpiozero/devices.py", line 124, in call self = super(GPIOMeta, cls).call(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/gpiozero/output_devices.py", line 418, in init self.pin.frequency = frequency
File "/usr/local/lib/python3.7/dist-packages/gpiozero/pins/init.py", line 358, in lambda self, value: self._set_frequency(value),
File "/usr/local/lib/python3.7/dist-packages/gpiozero/pins/init.py", line 354, in _set_frequency raise PinPWMUnsupported("PWM is not supported on pin %r" % self)
gpiozero.exc.PinPWMUnsupported: PWM is not supported on pin GPIO8

Is there some compatibility issue with the scripts and later versions of python3 + the gpiozero package?

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.