Skip to content

Instantly share code, notes, and snippets.

Rick Companje companje

Block or report user

Report or block companje

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View updtest.ino
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
EthernetUDP udp;
void setup() {
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0F, 0x36, 0x7D }; //MAC address of Arduino Ethernet
IPAddress ip(192, 168, 2, 177); //static IP-address of Arduino Ethernet
companje / ConvexHull.cpp
Last active Aug 29, 2015
ConvexHull in openFrameworks
View ConvexHull.cpp
//by Rick Companje
//based on Greg Borenstein's
#include "ofMain.h"
bool lexicalComparison(const ofPoint& v1, const ofPoint& v2) {
if (v1.x > v2.x) return true;
else if (v1.x < v2.x) return false;
else if (v1.y > v2.y) return true;
else return false;
companje / ButtonMatrix.ino
Created Jun 10, 2014
ButtonMatrix for Arduino without resistors or multiplexer chip
View ButtonMatrix.ino
const int ROWS=3;
const int COLS=5;
bool buttons[ROWS][COLS];
int rowPins[] = {2,3,4};
int colPins[] = {5,6,7,8,9};
void setup() {
for (int i=0; i<ROWS; i++) {
companje / arduino-socket-server.ino
Created Jul 3, 2014
Arduino socket server forwarding all data received on Serial port to all connected clients
View arduino-socket-server.ino
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,2, 177);
IPAddress gateway(192,168, 2, 100);
IPAddress subnet(255, 255, 255, 0);
EthernetServer server(23);
companje / gsnake.asm
Created Aug 25, 2014
SNAKE.COM v1.00 by Rick Companje 17/12/1996
View gsnake.asm
code Segment para public 'code'
assume cs:code,ds:code,es:code
locals ; remove if you want to assemble
jumps ; with Masm
org 100h
YES equ 1
NO equ 0
companje / socketserver.js
Created Aug 27, 2014
socketserver.js experiment
View socketserver.js
var socket = require('')
var express = require('express')
var app = express();
var http = require('http').Server(app);
var io = require('')(http);
var printer = {
id: 0,
name: "Ultimaker-F1A23B"
companje / globe.cpp
Created Sep 23, 2014
openFrameworks code for mouse rotating globe with conversion from quaternions to latitude longitude
View globe.cpp
#include "ofMain.h"
class ofApp : public ofBaseApp {
ofImage earth;
ofQuaternion qTo;
float angle;
ofVec3f axis;
View doorbell.js
var os=require('os');
var net=require('net');
var Gpio = require("onoff").Gpio;
var networkInterfaces=os.networkInterfaces();
var port = 8081;
var sockets = [];
var cols = [
new Gpio(7, 'in', 'both'),
new Gpio(8, 'in', 'both'),
companje /
Last active Aug 29, 2015
vxl bell script
usage() {
echo "Usage: $0 { on | off | install | reset | id | listen | log | kill | learn }"
on() {
echo 1 >/sys/class/gpio/gpio8/value
companje / shuttle_start.ino
Created Nov 7, 2014
Script to 'press' power button on Shuttle PC SH61R4
View shuttle_start.ino
//This code runs on MSP430 LaunchPad MSP-EXP430G2 and is compiled+uploaded with Energia
void setup() {
pinMode(P1_4,INPUT); //POWER BTN
// pinMode(P1_5,OUTPUT); //LED output
pinMode(P2_0,INPUT); //LED input
pinMode(P1_0,OUTPUT); //feedback LED1
pinMode(P1_6,OUTPUT); //feedback LED2, represents state of P2_0
You can’t perform that action at this time.