Giter Site home page Giter Site logo

arduinohue's Introduction

ArduinoHue

An Arduino Library for controlling the Philips Hue. This is a work in progress, but the basic functionality is present.

Different Versions

Eventually, there will be multiple flavors of the library which will connec to the network in different manners. The first version, which is available now, communicates with a computer over Serial and uses a Python script to post the data to the internet.

Usage

Make sure you have the following at the top of your sketch.

import <ArduinoHue.h>
import <SerialHue.h>

To create the SerialHue object,

SerialHue hue("192.168.1.10", &Serial);

void setup(){

}
void loop(){
  Serial.begin(9600);
  hue.connect("YOUR_DEVICE_ID", "YOUR_USERNAME");
  //Everything else.
}

Then, you can change colors and turn lights on or off using the following commands:

hue.turnOn(1);//1 is the Light ID.
hue.turnOff(2); //2 is the Light ID.
//1 is the light, 45000 is the hue, and 255 is the saturation;
//Hue is on the scale of 0 - 65,000 and saturation is on the scale of 0-255
hue.seHueSat(1,45000,255);

For the Arduino to communicate with the Hue Lights, you will need to run the SerialBridge.py python script on your computer. In that file, you will need to update the device id on line 5 to the device id of your Arduino (for instance COM5 on Windows or /dev/tty.usbmodemfd131 on a Mac). To use this script you will need the pySerial module (http://pyserial.sourceforge.net/) and the Requests module (http://docs.python-requests.org/en/latest/user/install.html#install).

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.