This file contains hidden or 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
<script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.min.js'></script> | |
<script src='https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.js'></script> | |
<link href='https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.css' rel='stylesheet'> |
This file contains hidden or 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
{ | |
"time": "2:07:04pm", | |
"price": "510.83", | |
"delta": "69.02", | |
"perc": "13.51", | |
"vol": 2930 | |
} | |
{ | |
"time": "2:07:06pm", |
This file contains hidden or 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 | |
import time | |
import RPi.GPIO as GPIO | |
from pubnub.pnconfiguration import PNConfiguration | |
from pubnub.pubnub import PubNub |
This file contains hidden or 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
def _callback(message,channel): | |
if message["type"]=="request" : | |
print" Received message = ", message["play"] | |
status=subprocess.call(["espeak","-s 120 -v en ",message["play"]], stdout=FNULL, stderr=subprocess.STDOUT) | |
if status==0 : | |
pubnub.publish().channel(pubnub_responsechannel).message(postive_response).async(publish_callback) | |
This file contains hidden or 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
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.4.17.0.js"></script> | |
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.1.4/mapbox.js'></script> | |
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"> | |
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.4/mapbox.css' rel='stylesheet' /> |
This file contains hidden or 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 cleanup(){ | |
try { | |
JSONObject payload = new JSONObject(); | |
JSONObject left = new JSONObject(); | |
JSONObject right = new JSONObject(); | |
left.put("left_yaw", 400); | |
left.put("left_pitch",400); | |
right.put("right_yaw", 400); | |
right.put("right_pitch",400); | |
payload.put("left_hand", left); |
This file contains hidden or 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
function handleMsg(msg) { | |
if (VISIBLE) { | |
addData(msg.pub, msg.subs); | |
} | |
} | |
pubnub = new PubNub({ | |
publishKey : 'demo', | |
subscribeKey : 'demo' | |
}) |
This file contains hidden or 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 JSONObject handleHand(Hand hand){ | |
boolean isLeft = hand.isLeft(); | |
String handName = (isLeft) ? "left" : "right"; | |
Vector direction = hand.direction(); | |
int yaw = (int) Math.toDegrees(direction.yaw()); | |
int pitch = (int) Math.toDegrees(direction.pitch()); | |
// Normalize Yaw and Pitch |
This file contains hidden or 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 <SPI.h> | |
#include <Ethernet.h> | |
#include <Pubnub.h> | |
#include "string.h" | |
#include "iotconnector.h" | |
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; | |
char pubkey[] = "PUBLISH KEYS HERE";char subkey[] = "SUBSCRIBE KEYS HERE";char channel[] = "iotchannel";char uuid[] = "Arduino"; |
This file contains hidden or 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 class LeapToServo implements Runnable{ | |
//Define Channel name | |
public static final String CHANNEL = "my_channel"; | |
//Create PubNub instance | |
private Pubnub pubnub; | |
//Create Leap Controller instance | |
private Controller controller; | |
//is Runnable running? | |
private boolean running; |