Skip to content

Instantly share code, notes, and snippets.

Avatar

Kevin kevinl95

View GitHub Profile
@kevinl95
kevinl95 / photon_christmas_tree.ino
Last active Dec 6, 2017
johngineer's Oscilloscope Christmas Tree code adjusted for the Particle Photon
View photon_christmas_tree.ino
#define TRACE_DELAY 15000 // trace delay in uS. making this longer will
// result in a straighter drawing, but slower
// refresh rate. making it too short will result
// in an angular blob.
#define NUM_POINTS 19 // our tree is defined by 19 x/y coord. pairs
#define X D0 // attach scope channel 1 (X)
#define Y D1 // attach scope channel 2 (y)
@kevinl95
kevinl95 / skeeter.html
Created May 26, 2017
HTML for making the HTTP requests that drive Skeeter
View skeeter.html
<ion-view title="Skeeter" id="page1" style="background-color:#036D70;">
<ion-content padding="true" class="has-header">
<div>
<img src="img/HUInigOUSSylDwF0M3qq_mrt.jpg" style="display: block; width: 100%; height: auto; margin-left: auto; margin-right: auto;">
</div>
<div>
<iframe width="0" height="0" border="0" name="dummyframe" id="dummyframe"></iframe>
<form action="https://api.particle.io/v1/devices/yourdevicehere/tone?access_token=yourtokengoeshere" method="POST" target="dummyframe">
<button class="button button-balanced button-block" name="17khz" value="17">Turn on the 17kHz Tone</button>
View output.js
function output( text, context ) {
var response = {
outputSpeech: {
type: "PlainText",
text: text
},
card: {
type: "Simple",
title: "Thornton Windchill",
View handler.js
exports.handler = function( event, context ) {
var http = require( 'http' );
var url = 'http://api.openweathermap.org/data/2.5/weather?zip=<YOURZIPCODEHERE>,us&units=imperial&APPID=<YOURAPIKEYHERE>';
http.get( url, function( response ) {
var data = '';