thomaschandler / home_led_arudino

WS2812 Controller. To be used in conjunction with https://github.com/thomaschandler/home_led_srv to control an LED Strip through HomeKit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Home LED

Pre-requisites

  • nanopb
    • Download and unzip to ext. Rename to nanopb
    • OSX: sudo easy_install pip; and sudo python -m pip install protobuf
  • Setup protocol buffers for go

Arduino IDE Setup

  • Sketch -> Include Library -> Add .ZIP library
    • Select nanopb folder
  • Sketch -> Include Library -> nanopb

Development

Proto

Build test

gcc -I ../ext/nanopb/ ../ext/nanopb/pb_decode.c ../ext/nanopb/pb_common.c led.pb.c proto.c proto_test.c

Use test

#!/bin/bash
./a.out $(echo 'led_string: {leds: {color: BLACK}}' | ./bin/protoc --encode ControlMessage led.proto)
echo 'led_string: {leds: {color: RED}, leds: {color: BLUE}}' | ./bin/protoc --encode ControlMessage led.proto | ./bin/protoc --decode ControlMessage led.proto

Build

Proto

While developing: ./bin/protoc led.proto -o led.pb

  • Assuming protoc has been extracted in proto directory

For Arduino:

  • source
  • python ext/nanopb/generator/nanopb_generator.py proto/led.pb
    • Assuming nanopb is in ext/nanopb

About

WS2812 Controller. To be used in conjunction with https://github.com/thomaschandler/home_led_srv to control an LED Strip through HomeKit

License:MIT License


Languages

Language:C 61.0%Language:C++ 39.0%