GithubHelp home page GithubHelp logo

smangels / pyluxafor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fmartingr/pyluxafor

0.0 1.0 0.0 25 KB

Simple helper library and CLI to interact with luxafor products

License: MIT License

Python 74.63% Jupyter Notebook 25.37%

pyluxafor's Introduction

pyluxafor

Helper interface and CLI to interact with luxafor products.

Install

git clone [email protected]:fmartingr/pyluxafor.git
cd pyluxafor
python3 setup.py install

Using the CLI

Pyluxafor provides the luxa command to interact with the USB led in the same way as the library does, with some helper commands to convert colors between RGB/Hex.

# Converts between hexadecimal to decimal color notations
luxa hex2dec 00ff00
luxa dec2hex 255 255 0

# Set a flag with a fixed color
luxa set --led=all #ff0000

# Fade
luxa fade --led=all --speed=10 #00ff00

# Strobe
luxa strobe --led=front --speed=100 --repeat=10 #0000ff

# Wave
luxa wave --wave 3 --duration=100 --repeat=200 #ff0000

# Pattern
luxa pattern --repeat=2 2

# Turns off the luxafor
luxa off

# Using the conversion helpers in one command
luxa set $(luxa dec2hex 255 0 0)

Using as a library

from luxafor import luxafor

lux = luxafor.Luxafor()

# Led types
luxafor.Leds.ALL
luxafor.Leds.FRONT
luxafor.Leds.BACK
luxafor.Leds.LEDn # Where n is a number from 1 to 6, refer to the class

# Set a basic color
# From: off, yellow, green, blue, magenta, cyan, red, white
lux.set_basic_color('green')

# Set a static color
lux.set_color(<red>, <green>, <blue>, <led>)

# Fade to a color
lux.fade(<red>, <green>, <blue>, <led>, <speed>)

# Strobe
lux.strobe(<red>, <green>, <blue>, <led>, <speed>, <repeat times>)

# Wave
# Wave types:
# 1: Short wave
# 2: Long wave
# 3: Overlapping short wave
# 4: Overlapping long wave
lux.wave(<red>, <green>, <blue>, <led>, <wave type>, <duration>, <repeat times>)

# Enable predefined pattern
# Patterns from 1 to 8
lux.pattern(<pattern number>, <repeat>)

# Turn off the luxafor
lux.turn_off()

pyluxafor's People

Contributors

fmartingr avatar pyup-bot avatar

Watchers

 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.