Skip to content

Instantly share code, notes, and snippets.

View geekscape's full-sized avatar

Andy Gelme geekscape

View GitHub Profile
@geekscape
geekscape / gist:127625
Created June 11, 2009 00:44
Aiko Device Handler prototype
/* AikoDeviceLightSensorHandler.pde
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Please do not remove the following notices.
* Copyright (c) 2009 by Geekscape Pty. Ltd.
* Documentation: http://github.com/geekscape/Aiko/tree/master/docs/FILL_ME_IN
* License: GPLv3. http://geekscape.org/static/arduino_license.html
* Version: 0.0
*
* Light Sensor Handler.
*
byte pinMap[] = {5, 6, 7, 8, 9, 10, 11, 12};
byte pinCount = sizeof(pinMap) / sizeof(byte);
int buttonPressTime = 250; // milliseconds
void setup(){
Serial.begin(115200);
for (byte index = 0; index < pinCount; index ++) {
pinMode(pinMap[index], OUTPUT);
@geekscape
geekscape / keybase.md
Created April 9, 2014 09:58
keybase.io proof

Keybase proof

I hereby claim:

  • I am geekscape on github.
  • I am geekscape (https://keybase.io/geekscape) on keybase.
  • I have a public key whose fingerprint is 73FB 7E29 1B0B FD52 B97E AA06 01A0 A26E 38F0 E0FF

To claim this, I am signing this object:

@geekscape
geekscape / history_item.txt
Created April 10, 2014 01:53
Raspberry Pi /History: Build avr-gcc tool chain for ATMega256RFR2
Raspberry Pi
Sun Mar 16 19:44:44 EST 2014 [andyg]
Build avr-gcc tool chain for ATMega256RFR2
- See http://www.nongnu.org/avr-libc/user-manual/install_tools.html
- See http://permalink.gmane.org/gmane.comp.gcc.patches/283638
- See https://github.com/matthijskooijman/pinoccio-firmware
- See http://apt.stderr.nl/pool/main/g/gcc-avr/gcc-avr_4.8-2.pinoccio1.tar.gz
Contains avr-gcc "02_support_rfr2.patch" used below
export PREFIX=/usr/local/avr
@geekscape
geekscape / udp_receive.js
Created June 14, 2014 04:15
NodeJS UDP/IPv6 simple server listen example
var PORT = 4000;
//var HOST = 'ip6-localhost';
var HOST = 'fdd5::1';
var dgram = require("dgram");
var server = dgram.createSocket("udp6");
server.on("error", function (err) {
@geekscape
geekscape / udp_send.js
Created June 14, 2014 04:18
NodeJS UDP/IPv6 simple send message example
//var HOST = 'ip6-localhost';
var HOST = 'fdd5::1';
var REMOTE_PORT = 4000;
var LOCAL_PORT = 4001;
var dgram = require('dgram');
var message = new Buffer('(data)');
var dgram = require('dgram'),
fs = require('fs'),
readline = require('readline');
var HOST = 'localhost';
var PORT = 4149;
//var client = dgram.createSocket('udp6');
var client = dgram.createSocket('udp4');
client.bind(0);
@geekscape
geekscape / led_matrix.js
Last active July 31, 2016 19:33
Example NodeBots (JavaScript) code for MakeBlock mBot LED Matrix
/*
* Titan Micro Electronics TM1640: 16 x 8 LED driver datasheet (Chinese)
* https://dl.dropboxusercontent.com/u/8663580/TM1640.pdf
*
* TODO: Turn this code into a module and use it in "nodebots.js".
* TODO: Make all functions available to the REPL.
*/
var five = require('johnny-five');
var board = five.Board();
@geekscape
geekscape / history_macosx_morse_install.txt
Created July 31, 2016 01:16
Mac OS X /History: Install Morse (robot simulator)
Wed 27 Jul 2016 21:33:05 AEST [andyg]
Install morse (robot simulator)
- See https://github.com/morse-simulator/morse
- See http://www.openrobots.org/morse/doc/stable/morse.html
- See http://www.openrobots.org/morse/doc/latest/user/installation.html
- See https://en.wikipedia.org/wiki/Robotics_simulator
brew switch python3 3.5.1 # for Blender
# brew switch python3 3.5.2 # back to normal !
@geekscape
geekscape / camera_grab_video.py
Created July 31, 2016 08:04
Morse robot simulator example
#!/Users/andyg/.virtualenvs/cv3/bin/python3
# Requires OpenCV 3.0.0 for GStreamer / cv2.VideoCapture() integration
# workon cv
#
# pip3 install scipy
# pip3 install pillow # provides PIL
import base64
import cv2
import numpy