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
#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
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
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
/* 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
/* 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
<?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
#include "application.h" | |
char lastTimeRec1[40]; | |
char lastTimeRec2[40]; | |
unsigned long lastTime = 0UL; | |
char publishString[40]; | |
bool whichOne = false; | |
void handleTest1( const char * event, const char * data ); |
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
// Original Spark Community Thread: http://community.spark.io/t/how-to-access-the-core-via-we-browser/9711 | |
// Code adapted from: http://arduino.cc/en/Tutorial/WebServer | |
/* Includes ------------------------------------------------------------------*/ | |
#include "application.h" | |
SYSTEM_MODE(AUTOMATIC); | |
TCPServer server = TCPServer(80); |
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
/** | |
****************************************************************************** | |
* @file application.cpp | |
* @authors Satish Nair, Zachary Crockett and Mohit Bhoite | |
* @version V1.0.0 | |
* @date 05-November-2013 | |
* @brief Tinker application | |
****************************************************************************** | |
Copyright (c) 2013 Spark Labs, Inc. All rights reserved. |