Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am harrisonhjones on github.
* I am harrisonhjones (https://keybase.io/harrisonhjones) on keybase.
* I have a public key whose fingerprint is 44A3 EA71 BECE C315 077F 3525 1EF7 42AB E0ED 275D
To claim this, I am signing this object:
@harrisonhjones
harrisonhjones / particleTMP36Example.ino
Last active September 19, 2015 19:37
Example: Reads a TMP36 temperature in a loop and exposes it as a Cloud variable and sends it out via serial
// Particle TMP36 Example
// Author: [email protected]
// Description: Reads a TMP36 temperature in a loop and exposes it as a Cloud variable and sends it out via serial
// Connection: Connect VS to 3.3v, GND to GND, VOUT to A0. See http://www.analog.com/media/en/technical-documentation/data-sheets/TMP35_36_37.pdf for pin information
//
/* How it works:
The TMP36 outputs a voltage proportional ot the current temperature.
The resolution is 10 mv / degree centigrade (100 degrees centigrade / volt). There is a 500 mV offset (.5v) so negative temperatures can be measured
*/
@harrisonhjones
harrisonhjones / phpSpark.class.php
Created September 20, 2015 19:07
phpDashboard - phpSpark class
<?php
/*
* @project phpSpark
* @file phpSpark.class.php
* @authors Harrison Jones ([email protected])
* Devin Pearson ([email protected])
* @date March 12, 2015
* @brief PHP Class for interacting with the Spark Cloud (spark.io)
*/
@harrisonhjones
harrisonhjones / example.ino
Created September 21, 2015 18:42
Particle IO - InternetButton - IFTTT
#include "InternetButton/InternetButton.h"
#include "math.h"
// Set up lots of global variables that we'll be using
InternetButton b = InternetButton();
uint8_t button1 = 0;
uint8_t button2 = 0;
uint8_t button3 = 0;
uint8_t button4 = 0;
uint8_t buttonAll = 0;
@harrisonhjones
harrisonhjones / example.cpp
Last active September 23, 2015 06:31
Particle IO - TCP Client Test
TCPClient client;
bool over = false;
void setup()
{
// Make sure your Serial Terminal app is closed before powering your device
Serial.begin(9600);
// Now open your Serial Terminal, and hit any key to continue!
while(!Serial.available()) SPARK_WLAN_Loop();
@harrisonhjones
harrisonhjones / example.cpp
Created September 25, 2015 01:56
Particle IO - ElapsedMillis Example
#include "elapsedMillis/elapsedMillis.h"
elapsedMillis timeElapsed;
unsigned char readSoilStateMachine = 0;
int rd = 0; // Global soil moisture value
void loop()
{
readSoil(); // Run this as often as possible (it's non-blocking)
}
@harrisonhjones
harrisonhjones / example.cpp
Last active December 20, 2016 08:11
Particle IO - serialEvent Emulation
// #define USING_SERIAL2 // Uncomment if you need to use Serial2
#ifdef USING_SERIAL2
#include "Serial2/Serial2.h" // Only needed if you use Serial2
void serialEvent2(){
Serial.print("Data is available on serial2");
Serial2.read();
}
#endif
@harrisonhjones
harrisonhjones / example.cpp
Created October 1, 2015 08:00
Particle IO - IFTTT Google Drive Spreadsheet Update Example
// IFTTT Google Drive Spreadsheet Update Example
// Use with https://ifttt.com/recipes/329485-update-a-spreadsheet-on-event use eventName "VOLTS"
// Author: Harrison Jones ([email protected])
char message[180];
void setup() {}
void loop() {
doublevolts = analogRead(A0) * 3.3 / 4096.0;
git clone [email protected]:texane/stlink.git
cd stlink
./autogen.sh
./configure
make
make install
@harrisonhjones
harrisonhjones / application.ino
Created January 1, 2016 22:43
Particle - Internet Button Motion Grab
#include "InternetButton/InternetButton.h"
#include "math.h"
/*Did you know that the SparkButton can detect if it's moving? It's true!
Specifically it can read when it's being accelerated. Recall that gravity
is a constant acceleration and this becomes very useful- you know the orientation!*/
InternetButton b = InternetButton();