Things used in this project

Hardware components:
Neopixel strip
NeoPixel strip
×1
Photon new
Particle Photon
get a headerless photon, you don't need the pins
×1
Adafruit industries ada260 image 90px
USB-A to Mini-USB Cable
×1
Software apps and online services:
Particle.io API
Hand tools and fabrication machines:
09507 01
Soldering iron (generic)

Schematics

Neopixel to Photon Schematic
Connect the wires
Fbl2bjk7ceiijhefigvf

Code

Web code to start a light showJavaScript
This is the code for your website that starts a light show by passing through a light show mode to your Photon. On a button click, pass through a 'mode' parameter, like 'blue', 'red', or 'rainbow'
import {Injectable} from '@angular/core';
import { Http, Response, Headers } from '@angular/http';
import {LogService} from '../../core/services/log.service';
import {Observable} from 'rxjs/Rx';
import 'rxjs/add/operator/map';


@Injectable()
export class PhotonService {
  private requestURl: string;
  private accessToken: string;

  constructor(
    private logger: LogService,
    private http: Http) {
      logger.debug(`Photon initializing...`);
      //device id
      this.requestURl = 'https://api.particle.io/v1/devices/<post your api key here>/startRave/';
      //access token
      this.accessToken = '<post your access token here>';
  }

public startLightShow(mode: string) {

  let params = 'command=' + mode + '&access_token=' + this.accessToken;

  let headers = new Headers();
  headers.append('Content-Type', 'application/x-www-form-urlencoded');

  this.http.post(this.requestURl, params, {headers: headers})
    .map(res => res.json())
    .subscribe(
      data => params,
      err => this.handleError(err),
      () => console.log('Post Complete')
    );
}

  private handleError(error: Response) {
      return Observable.throw(error);
  }


}

Credits

7a2730fc6fd826ace7f1ce9bcabee05b
Jen Looper

Founder: http://t.co/DOXReolRYV, indie web and mobile developer, Developer Relations team member at Telerik. Queen of the Apps!

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

IoT Drone - Part 1 - Motor Control
Intermediate
  • 1,363
  • 27

Work in progress

After flying a friends drone I was hooked. However, I wanted to build my own, so this is part one of my drone project - motor control.

Bike Swarm
Intermediate
  • 611
  • 13

Work in progress

Cyclists will be able to connect seamlessly to form a synchronized swarm of riders to reduce traffic congestion and improving safety.

Bike Swarm

Team Bright Water Bottle

Smart Maid
Intermediate
  • 1,315
  • 21

Full instructions

Hack your existing iRobot Create with Particle and control it through Alexa.

Smart Maid

Team Yosnalab

"Internet-controlled" Nespresso Machine
Intermediate
  • 2,618
  • 8

Using a chatbot and a Nespresso machine to make coffee remotely.

IoT Smart Desk Drawer with Amazon DRS
Intermediate
  • 461
  • 4

Never run out of office supplies again. PostIt notes, stamps, paperclips, tape and paper replenished from the cloud.

Home Theater Accent Lights
Intermediate
  • 307
  • 1

Full instructions

Particle Photon and SmartThings controlled WS2812B.

Add projectSign up / Login
Respect project