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
#include <Servo.h> | |
#include <stdint.h> | |
#include <TouchScreen.h> | |
#include <TFT.h> | |
//16-bit colors, not quite HTML codes even though they look like it... It's a pain: | |
//http://en.wikipedia.org/wiki/High_color#16-bit_high_color | |
#define SAMSUNG_BLUE 0x1111 | |
#define SAMSUNG_CYAN 0x0d3c | |
#define SAMSUNG_GREY 0xbdd7 |
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
api.buglabs.net | |
community.buglabs.net | |
communityasset0.buglabs.net | |
communityasset1.buglabs.net | |
communityasset2.buglabs.net | |
communityasset3.buglabs.net | |
cvs.buglabs.net | |
demo.buglabs.net | |
demo-ws.buglabs.net | |
repository.buglabs.net |
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
Location is the same as normal, but with some extra data that isn't strictly necessary | |
{ | |
'feed': { | |
'latitude': '', | |
'satellites': 0, | |
'valid': False, | |
'longitude': '' | |
}, | |
'name': 'Location' |
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
/* | |
* Sleep Pulse Firmware - firmware code for the Sleep Pulse Device. | |
* This runs on an Atmel 328P microprocessor, at 5 volts, with a 16 MHz crystal | |
* Within the arduino IDE, select "Arduino Pro or Pro Mini (5V, 16MHz) w/ATmega328" as the Board | |
*/ | |
#include <math.h> | |
#include <EEPROM.h> | |
// Prototype pin definitions - don't change these! |
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
<html> | |
<head> | |
<script type="text/javascript" src="http://cdn.buglabs.net/swarm/swarm-v0.4.0.js"></script> | |
</head> | |
<body> | |
<script> | |
/* Open this file twice or more and you should be able | |
to see presence in the developer console of your browser. */ | |
function onPresence(presence) { | |
console.log('presence -> ' + Date.now() + ':' + JSON.stringify(presence)); |
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 usb.core | |
import usb.util | |
import sys | |
from commands import getstatusoutput | |
import json | |
# find our device | |
dev = usb.core.find(idVendor=0x045b, idProduct=0x0212) | |
# was it found? | |
if dev is None: |
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
public void run(Map<Object, Object> services) { | |
IVonHippelModuleControl vh = (IVonHippelModuleControl) services.get(IVonHippelModuleControl.class.getName()); | |
System.out.println("sysfstest start"); | |
try { | |
vh.setIOX(0); | |
vh.setIOX(1); | |
vh.setIOX(2); | |
vh.setIOX(3); | |
} catch (IOException e) { e.printStackTrace(); } | |
try { |
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
POST /stream?resource_id=c7cf00fc21622a15f15bd390a698af3f34efd9bc&swarm_id=0d86ad8e7f33d4c9bb33d38ef9295f897a636523 HTTP/1.1 | |
Host: api.bugswarm.net | |
Accept: application/json | |
X-BugSwarmApiKey: 7a849e6548dbd6f8034bb7cc1a37caa0b1a2654b | |
Connection: close | |
User-Agent: SwarmSessionImp | |
Transfer-Encoding: chunked | |
Content-Type: application/json ;charset=UTF-8 | |
X-Forwarded-For: 69.195.32.42 |
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 WebSocket = require('ws') | |
, ws = new WebSocket('ws://api.cosm.com:8080/'); | |
var API_KEY = "" //ENTER API KEY HERE. | |
ws.on('open', function() { | |
ws.send('{"headers":{"X-ApiKey":"'+API_KEY+'"}, "method":"subscribe", "resource":"/feeds/61916/datastreams/sine60"}'); | |
}); | |
ws.on('message', function(message) { | |
console.log('received: %s', message); | |
}); |
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
#define BUFFLEN 200 | |
#define NUMLEDS 5 | |
#define MAXVALUES 3 | |
#define ACT_FADEUP 1 | |
#define ACT_FADEDOWN 2 | |
#define ACT_BLINK 3 | |
int leds[] = {3, 5, 6, 9, 10}; | |
int act[NUMLEDS]; |