photo
text

phpSpark

PHP Class for interacting with the Spark Cloud (spark.io)

Installation

  • GIT clone or download a zip of the repo and unzip into your project director
  • Rename phpSpark.config.sample.php to phpSpark.config.php
  • Set your access token and device id in phpSpark.config.php
  • (Optional) Copy and paste the code in spark.firmware.cpp into a new app in the Spark WebIDE & flash it to your core
  • (Optional) Run the any of the examples in the examples folder

Usage

See phpSpark.examples.php

Implemented Features

  • List Devices
  • Get device info
  • Rename/Set device name
  • Call Spark Function on a device
  • Grab the value of a Spark Variable from a device
  • Generate a new access token
  • List your access tokens
  • Delete an access token
  • Use a local spark cloud
  • List Webhooks
  • Delete Webhook
  • Remote (Over the Air) Firmware Uploads

Code Repository

Code for this project is available here on Github

text

RGBEffect

A RGB effects library for Spark Core. Allows you to do easily perform different animations with your Spark Core's RGB LED.

Installation

SparkCore (OTA for Demoing)

  • Navigate to The Demo Web App
  • Follow the instructions to flash the latest demo firmware to your Spark Core over the air (OTA) and control it once it's there.

SparkCore (for Development)

  • Add RGBEffect.cpp & RGBEffect.h to your project
  • Add a #include "RGBEffect.h" to the top of your main project file
  • Look at the demos/usage below

Usage

This library is much more complicated than my original LEDEffect library, which this library is loosely based on. To use this library you must first define colors (sort of like a color palette) and then you can use those defined colors with different effects.

List of Available Effects

  • off - turns the RGB LED off
  • on - assigned a specified color to the RGB LED
  • breath - smoothly fades between the different colors designed by the colorNumSequence which is an array of color numbers
  • fade - similar to breath but when the end of the sequence is reached the first color is jumped to sharply. Can be used to create a near fading up or fading down effect
  • blink - blinks the color sequence

Interacting with Colors

  • setColor - used to associate a red, green, blue color to a specific color number
  • swapColors - used to swap two colors in the palette

Code Repository

Code for this project is available here on Github

photo

E-Paper Business Card

IMG20141207001716.jpg

Playing around with business card ideas now that I have my Spark e-paper library working. E-paper is awesome!

text

SparkTOTP

SparkTOTP is a Spark library to generate TOTP codes based on the OpenAuthentication Time-based One-time Password Algorithm (RFC 623😎. Codes are generated using the Spark's on-board cloud-synced estimation of the current time.

Demo GIF

GIF showing code 588209

Code Repository

Code for this project is available here on Github