Skip to content

Instantly share code, notes, and snippets.

View hdurdle's full-sized avatar
🔒

Howard Durdle hdurdle

🔒
View GitHub Profile
@hdurdle
hdurdle / arduino-rgb-test.ino
Last active August 29, 2015 14:12
Arduino RGB test
#define REDPIN 3
#define GREENPIN 5
#define BLUEPIN 6
void setup ()
{
Serial.begin(57600);
pinMode(REDPIN, OUTPUT);
pinMode(GREENPIN, OUTPUT);
pinMode(BLUEPIN, OUTPUT);
@hdurdle
hdurdle / arduino-rgb-serial.ino
Last active June 12, 2016 03:49
Arduino RGB Serial Control
#define REDPIN 3
#define GREENPIN 5
#define BLUEPIN 6
unsigned long lastCommandDelay = 30000;
unsigned long timeLastCommand;
byte inByte = 0;
char code[4];
int bytesread = 0;
@hdurdle
hdurdle / Write-LED.ps1
Created January 3, 2015 14:40
Powershell Serial Control of Arduino
Param(
[string]$hexColor
)
if ($hexColor.length -eq 3) {
$hexColor = $hexColor.Substring(0,1) * 2 + $hexColor.Substring(1,1) * 2 + $hexColor.Substring(2,1) * 2
}
if ($hexColor.length -eq 6) {
$r = 0
$g = 0
$b = 0
@hdurdle
hdurdle / soundlight.py
Created January 3, 2015 15:32
soundlight (Python to Arduino)
import alsaaudio, wave
import numpy
import serial
import time
import struct
MAX = 0
def arduino_soundlight():
chunk = 2**9 # Change if too fast/slow, I've tried 2**9 through 2**11
@hdurdle
hdurdle / Write-LED.py
Created January 3, 2015 15:42
Send Full Red via Serial
import serial
import time
command = bytearray([4,255,0,0,10])
port = serial.Serial("/dev/ttyACM0", baudrate=57600, timeout=3.0)
time.sleep(2)
port.write(command)

Keybase proof

I hereby claim:

  • I am hdurdle on github.
  • I am hdurdle (https://keybase.io/hdurdle) on keybase.
  • I have a public key whose fingerprint is 03C6 5CB7 CB85 2390 4B17 376A 8C44 7539 0F2A E06A

To claim this, I am signing this object:

# Download the new Apple TV aerial videos
Import-Module BitsTransfer
$sourceurl = "http://a1.phobos.apple.com/us/r1000/000/Features/atv/AutumnResources/videos/entries.json"
$data = Invoke-WebRequest -Uri $sourceurl | ConvertFrom-Json
foreach ($vid in $data) {
foreach($asset in $vid.assets) {
$url = $asset.url
#!/usr/bin/python
#
# Copyright 2015 - fullTalgoRythm
#
# Licensed under GNU General Public License 3.0 or later.
# Some rights reserved. See COPYING, AUTHORS.
#
# @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
#
# see http://www.domoticz.com/wiki/Evohome
#include <SPI.h>
#include <Ethernet.h>
int bluPin = 6;
int grnPin = 5;
int redPin = 3;
int redVal = 0;
int bluVal = 0;
int grnVal = 0;
import java.security.MessageDigest
preferences {
input("domoticzIP", "text", title: "Domoticz IP Address", description: "IP Address of the Server")
input("deviceID", "text", title: "Device ID", description: "The device id")
}
metadata {
definition(name: "Domoticz Dimmer Switch", namespace: "hdurdle-smartthings", author: "Howard Durdle") {
capability "Switch"