Skip to content

Instantly share code, notes, and snippets.

View DarylWM's full-sized avatar

Daryl Wilding-McBride DarylWM

View GitHub Profile
{ "type": "inf", "msg": "an info message" }
{ "type": "img", "msg": { "seg": { "rem": 345, "enc": "YW4gZW5jb2RlZCBtc2c=" } } }
require 'serialport'
require 'json'
require 'base64'
sp = SerialPort.new "/dev/cu.usbmodem1d11", 115200, 8, 1, SerialPort::NONE
imageBytes = ""
loop {
jsonMessage = sp.gets.tr("\n\r", "")
begin
parsedMessage = JSON(jsonMessage)
// This program takes a snapshot and sends it to the XBee module
#include <Adafruit_VC0706.h>
#include <SoftwareSerial.h>
#include <Base64.h>
// On Uno: camera TX connected to pin 2, camera RX to pin 3:
SoftwareSerial cameraconnection = SoftwareSerial(2, 3); // Arduino RX, TX
Adafruit_VC0706 cam = Adafruit_VC0706(&cameraconnection);
char payload[2+info.length()];
payload[0] = 0xf3; // payload type
PString infoString(&payload[1], sizeof(payload)-1);
infoString.print(info);
// Specify the address of the remote XBee (this is the SH + SL)
XBeeAddress64 addr64 = XBeeAddress64(0x0, 0x0); // Coordinator address
// Create a TX Request
ZBTxRequest zbTx = ZBTxRequest(addr64, (uint8_t *)payload, sizeof(payload));
// Send the request
xbee.send(zbTx);
// This program takes a snapshot and sends it to the XBee module
#include <Adafruit_VC0706.h>
#include <SoftwareSerial.h>
#include <XBee.h>
#include <PString.h>
// On Uno: camera TX connected to pin 2, camera RX to pin 3:
SoftwareSerial cameraconnection = SoftwareSerial(2, 3); // Arduino RX, TX
Adafruit_VC0706 cam = Adafruit_VC0706(&cameraconnection);
# Continuously read the serial port and process IO data received from a remote XBee.
from xbee import ZigBee
import serial
import struct
from array import array
import boto
import boto.s3
from datetime import datetime, date, time
import sys
@DarylWM
DarylWM / ricky-1.sh
Last active December 29, 2015 16:49
name := "sample-with-cucumber"
version := "1.0-SNAPSHOT"
libraryDependencies ++= Seq(
javaJdbc,
javaEbean,
cache
"info.cukes" % "cucumber-java" % "1.1.5" % "test",
"info.cukes" % "cucumber-junit" % "1.1.5" % "test"
@DarylWM
DarylWM / ricky.sh
Last active December 29, 2015 16:49
$ mkdir features