This file contains 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
from blinkstick import blinkstick | |
import requests | |
import serial | |
import webcolors | |
import time | |
import json | |
# url to fetch from | |
cheer_lights_url = "http://api.thingspeak.com/channels/1417/field/1/last.json" | |
serial_port = '/dev/tty.usbmodem1421' |
This file contains 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
// color swirl! connect an RGB LED to the PWM pins as indicated | |
// in the #defines | |
// public domain, enjoy! | |
#define REDPIN 5 | |
#define GREENPIN 6 | |
#define BLUEPIN 3 | |
#define FADESPEED 5 // make this higher to slow down | |
This file contains 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
import platform | |
import requests | |
class Choir: | |
def __init__(self, agentConfig, checksLogger, rawConfig): | |
self.agentConfig = agentConfig | |
self.checksLogger = checksLogger | |
self.rawConfig = rawConfig | |
self.version = platform.python_version_tuple() |
This file contains 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
#!/usr/bin/env python | |
# | |
# Copyright 2007 Google Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains 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
#!/usr/bin/python | |
""" | |
Download this script and run it as | |
``` | |
python thenameofthefile.py | |
``` | |
or |
This file contains 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
var BMP085 = require('bmp085'), | |
barometer = new BMP085( | |
{ | |
'mode' : 0, | |
'address': 0x77, | |
'device': '/dev/i2c-0' | |
} | |
); | |
barometer.read(function (data) { | |
console.log("Temperature:", data.temperature); |
This file contains 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
$ npm install i2c | |
npm http GET https://registry.npmjs.org/i2c | |
npm http 304 https://registry.npmjs.org/i2c | |
npm http GET https://registry.npmjs.org/bindings | |
npm http GET https://registry.npmjs.org/underscore/1.2.4 | |
npm http GET https://registry.npmjs.org/coffee-script/1.3.3 | |
npm http GET https://registry.npmjs.org/repl/0.1.3 | |
npm http 304 https://registry.npmjs.org/coffee-script/1.3.3 | |
npm http 304 https://registry.npmjs.org/bindings | |
npm http 304 https://registry.npmjs.org/underscore/1.2.4 |
This file contains 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
execve("node-v0.11.7-linux-arm-pi/bin/node", ["node-v0.11.7-linux-arm-pi/bin/no"...], [/* 17 vars */]) = -1 ENOENT (No such file or directory) | |
dup(2) = 3 | |
fcntl64(3, F_GETFL) = 0x20002 (flags O_RDWR|O_LARGEFILE) | |
fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 | |
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f07000 | |
_llseek(3, 0, 0xbead3308, SEEK_CUR) = -1 ESPIPE (Illegal seek) | |
write(3, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory | |
) = 40 | |
close(3) = 0 | |
munmap(0xb6f07000, 4096) = 0 |
This file contains 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
pi@neptr ~ $ uname -a | |
Linux neptr 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux | |
pi@neptr ~ $ curl -O http://nodejs.org/dist/v0.11.7/node-v0.11.7-linux-arm-pi.tar.gz | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 4843k 100 4843k 0 0 816k 0 0:00:05 0:00:05 --:--:-- 939k | |
pi@neptr ~ $ tar zxf node-v0.11.7-linux-arm-pi.tar.gz | |
pi@neptr ~ $ node-v0.11.7-linux-arm-pi/bin/node -e 'console.log("hello")' | |
-su: node-v0.11.7-linux-arm-pi/bin/node: No such file or directory | |
pi@neptr ~ $ ldd node-v0.11.7-linux-arm-pi/bin/node |
This file contains 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
http://bildr.org/2011/07/ds18b20-arduino/ - Temperature sensor | |
http://bildr.org/2012/11/photoresistor-arduino/ - Light sensor | |
http://www.ebay.co.uk/itm/Soil-Hygrometer-Detection-Buzzer-Alarm-Module-Moisture-Sensor-Cable-For-Arduino-/390643155171?pt=UK_BOI_Industrial_Automation_Control_ET&hash=item5af42580e3 - In analog mode just read straight from the analog input | |
www.maplin.co.uk/amazing-h2o-pump-228295 - Water pump | |
http://www.ebay.co.uk/itm/360626244581?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649 - Irrigation system | |
http://www.ebay.co.uk/itm/Nano-V3-0-ATmega328P-Arduino-Compatible-/171078373098?pt=LH_DefaultDomain_0&hash=item27d510ceea - Nano |