This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "Program Start<br/>"; | |
/* Desired Curl Command | |
curl https://api.spark.io/v1/devices/0123456789abcdef/brew \ | |
-d access_token=123412341234 \ | |
-d "args=coffee" | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Includes ------------------------------------------------------------------*/ | |
#include "application.h" | |
#include "flashHelper.h" | |
#include "Adafruit_mfGFX.h" | |
#include "Adafruit_SharpMem.h" | |
extern char* itoa(int a, char* buffer, unsigned char radix); | |
// Debug | |
// Turn ON DEBUG statements |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Includes ------------------------------------------------------------------*/ | |
//#include "application.h" | |
#include "PietteTech_DHT.h" // From: https://github.com/piettetech/PietteTech_DHT | |
/* Function prototypes -------------------------------------------------------*/ | |
void dht_wrapper(); // must be declared before the lib initialization | |
// Explicit Declaration of System Mode | |
SYSTEM_MODE(AUTOMATIC); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char eventMessages[10][65]; // 10 messages of a max 65 char length | |
char eventMessage[65]; // A buffer for outgoing publish events | |
int queueIndex = -1; // -1 = nothing to send, 0+ = a message is queued | |
// In your main loop(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SYSTEM_MODE(MANUAL); | |
void setup() | |
{ | |
Serial.begin(9600); | |
WiFi.on(); | |
WiFi.connect(); | |
} | |
void loop() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define APP_VERSION 1.1 | |
double distance = 0; | |
double echo = 0; | |
int ultraSoundSignal = D0; // Ultrasound signal pin | |
// Elapsed Millis Stuff | |
unsigned int publishInterval = 2000; // Every 2000 ms (2 seconds) | |
elapsedMillis timeElapsed; //declare global if you don't want it reset every time loop runs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This program will blink an led on and off every second. | |
// It blinks the D7 LED on your Particle device. If you have an LED wired to D0, it will blink that LED as well. | |
// First, define the pins we are going to use. | |
int led = D0; // You'll need to wire an LED to this one to see it blink. | |
int led2 = D7; // This one is the little blue LED on your board. On the Photon it is next to D7, and on the Core it is next to the USB jack. | |
// This routine runs only once when the device boots up or is reset | |
void setup() { | |
// We are going to tell our device that D0 and D7 (which we named led and led2 respectively) are going to be output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -------------------------------------------- // | |
// Documentation | |
// ------------------ | |
// -------------------------------------------- // | |
// Compiler Defines | |
// ------------------ | |
#define APP_VERSION 1.2 // Keep track of what version this code is | |
#define NUM_MEASUREMENTS 20 // The number of measurements we want to take befoe averaging and publishing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Project: Door Controller | |
// Description: A simple Pebble app for controlling my Particle-powered door lock | |
// Author: Harrison Jones ([email protected]) | |
// Date: 6/7/2015 | |
// -------- Includes -------- /// | |
var UI = require('ui'); | |
var ajax = require('ajax'); | |
//var Vector2 = require('vector2'); | |
//var Accel = require('ui/accel'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint node: true */ | |
"use strict"; | |
// Setup the modules we need to use | |
var spark = require('spark'); | |
var fs = require('fs'); | |
// Login and start doing things! | |
spark.on('login', function() { | |
//Get test event for specific core |