PyLEdLang compiler on top of Python3
Project description
PyLEDLang
The simple amazing software for RGB lights.
Explaination.
The compiler is an small python lib that converts your amazing python code to an PyLEDasm (text lang that led controller will understand). So it does an magic :) It can convert this
from code import Compiler
def main():
x=Compiler()
for a in range(0,10):
x.set_color(a*25,a*25,a*25)
x.sleep(20)
x.final_build()
pass
main()
In to:
;user defined color from hex 0 0 0
reg clr:000000
;user defined delay block via sleep method: 20 cycles
slp:00 -> sleep
;user defined color from hex 25 25 25
reg clr:191919
;user defined delay block via sleep method: 20 cycles
slp:00 -> sleep
;user defined color from hex 50 50 50
reg clr:323232
;user defined delay block via sleep method: 20 cycles
slp:00 -> sleep
;user defined color from hex 75 75 75
reg clr:4B4B4B
;user defined delay block via sleep method: 20 cycles
slp:00 -> sleep
;user defined color from hex 100 100 100
reg clr:646464
;user defined delay block via sleep method: 20 cycles
slp:00 -> sleep
;user defined color from hex 125 125 125
reg clr:7D7D7D
;user defined delay block via sleep method: 20 cycles
slp:00 -> sleep
;user defined color from hex 150 150 150
reg clr:969696
;user defined delay block via sleep method: 20 cycles
slp:00 -> sleep
;user defined color from hex 175 175 175
reg clr:AFAFAF
;user defined delay block via sleep method: 20 cycles
slp:00 -> sleep
;user defined color from hex 200 200 200
reg clr:C8C8C8
;user defined delay block via sleep method: 20 cycles
slp:00 -> sleep
;user defined color from hex 225 225 225
reg clr:E1E1E1
;user defined delay block via sleep method: 20 cycles
slp:00 -> sleep
To do it just an run your main.py in console.
py main.py output_final.bin True
Where output_final.bin is output filename and True is an for including an debug info.
PyLEDasm rules:
- All comments starts with ;
- reg clr changes an color on output of /dev/color_rgb
- slp:00 -> sleep delays an programm for one cylce.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyledlanglib-0.1.2.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for pyledlanglib-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cb0a9e6965b7e746f699ef765d7bf8431868665cca7deebec7c4d96238098a7 |
|
MD5 | 749e6252dcd9c4920ebc99143238e0eb |
|
BLAKE2b-256 | 54291852cd64ff1c973db5c382d16c0159ab2a6fa98e9522bd9c6fa0288192ac |