Skip to content

Instantly share code, notes, and snippets.

@harrisonhjones
harrisonhjones / light.py
Last active November 9, 2023 21:57
p9813 ESPHome Component
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import pins
from esphome.components import light, output
from esphome.const import CONF_OUTPUT_ID, CONF_CLOCK_PIN, CONF_DATA_PIN
from esphome.cpp_helpers import gpio_pin_expression
namespace = cg.esphome_ns.namespace('p9813')
P9813LightOutput = namespace.class_('P9813LightOutput', light.LightOutput)
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="alice">This is a simple enqueue.</Say>
<Enqueue waitUrl="wait-music.xml">support</Enqueue>
</Response>
Verifying my Blockstack ID is secured with the address 1MbUZm8i8zK6YinYzWyvG4MEErAAtUt3SM https://explorer.blockstack.org/address/1MbUZm8i8zK6YinYzWyvG4MEErAAtUt3SM
@harrisonhjones
harrisonhjones / publishEventParticleConsole.user.js
Last active January 6, 2017 02:35
TamperMonkey Script - PublishEvent for the Particle Console
// ==UserScript==
// @name Publish Event for the Particle Console
// @namespace http://harrisonhjones.com
// @version 1.5
// @updateURL https://gist.github.com/harrisonhjones/4568e192ed5723aba02f35c2153e63e9/raw/publishEventParticleConsole.user.js
// @downloadURL https://gist.github.com/harrisonhjones/4568e192ed5723aba02f35c2153e63e9/raw/publishEventParticleConsole.user.js
// @description Adds a "Publish Event" link to the Particle Console logs page.
// @author Harrison Jones ([email protected])
// @match https://console.particle.io/*
// @grant none
// Author: Harrison Jones ([email protected])
// Date: Dec 18, 2016
// Special System Declarations
SYSTEM_THREAD(ENABLED); // Use system threading so the code works even while it's connecting to the internet
// Constants
const uint8_t switchPin = D2; // Switch should be connected between this pin and GND
const uint8_t onboardLED = D7; // Onboard LED is connected to D7
const char *pubEventName = "EventName"; // The event name that is published
<!DOCTYPE>
<html>
<body>
<center>
<h1>Call Function</h1>
Control the LED --->
<button onclick="callFunction('on');" value="Do it!">Turn the LED on.</button>
<button onclick="callFunction('off');" value="Do it!">Turn the LED off.</button>
// ==UserScript==
// @name Particle Docs Next Arrow Tweak
// @namespace https://docs.particle.io
// @version 0.4
// @description Scoots the "next" arrow over a bit on the Particle docs so the scroll bars work
// @author Harrison Jones ([email protected])
// @match https://docs.particle.io/*
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// @updateURL https://gist.github.com/harrisonhjones/c3bc07a0aa82d5ffc4f7/raw/docsnextarrowtweak.user.js
@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();
git clone [email protected]:texane/stlink.git
cd stlink
./autogen.sh
./configure
make
make install
@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;