Skip to content

Instantly share code, notes, and snippets.

Markus Leutwyler ghtomcat

View GitHub Profile
View arduino_lightseeker.ino
// META PARAMETERS USED FOR TRAINING
// Generation: 143 of 200
// No of experiments per generation: 300
// Spot light displacement: 3.5
// Angular velocity punishment: 10000
// Runtime (episode duration in seconds): 4
// Initial weight max: 4
// Final weight max: 0.25
// Motor force multiplier: 10
// Number of Hidden nodes: 10
View sumobot_latest.js
var keypress = require('keypress');
var five = require("johnny-five");
var EtherPortClient = require("etherport-client").EtherPortClient;
var board = new five.Board({
port: new EtherPortClient({
host: "xx.xx.xx.xx",
port: 3030
}),
View odessajs_sumobot.js
var keypress = require('keypress');
var five = require("johnny-five");
var EtherPortClient = require("etherport-client").EtherPortClient;
var board = new five.Board({
port: new EtherPortClient({
host: "xx.xx.xx.xx",
port: 3030
}),
View makemunich_sumobot.js
var keypress = require('keypress');
var five = require("johnny-five");
var EtherPortClient = require("etherport-client").EtherPortClient;
var board = new five.Board({
port: new EtherPortClient({
host: "192.168.1.235",
port: 3030
}),
View etherport_motor.js
var EtherPortClient = require("etherport-client").EtherPortClient;
var keypress = require('keypress');
var five = require("johnny-five");
var EtherPortClient = require("etherport-client").EtherPortClient;
var board = new five.Board({
port: new EtherPortClient({
host: "192.168.192.7",
port: 3030
}),
View drive_motor.js
var five = require('johnny-five');
var keypress = require('keypress');
var board = new five.Board();
board.on('ready', function() {
console.log('Welcome to Sumobot!');
console.log('Control the bot with the arrow keys, and SPACE to stop.');
View drive_servo.js
var five = require('johnny-five');
var keypress = require('keypress');
var board = new five.Board({port:"/dev/tty/AdafruitEZ-Link6b34-SPP"});
board.on('ready', function() {
console.log('Welcome to Sumobot!');
console.log('Control the bot with the arrow keys, and SPACE to stop.');
var servoL = new five.Servo.Continuous(9);
View drive.js
var five = require('johnny-five');
var keypress = require('keypress');
var board = new five.Board();
board.on('ready', function() {
console.log('Welcome to Sumobot!');
console.log('Control the bot with the arrow keys, and SPACE to stop.');
@ghtomcat
ghtomcat / socket_server.js
Created Jul 17, 2012
node.js server for EnyoSlides
View socket_server.js
var io = require('socket.io').listen(8080);
console.log("listening on port 8080");
// Socket Routes
io.sockets.on('connection', function (socket) {
socket.on('setPresenter', function(){
socket.set('presenter', true, function(){
socket.emit('ready');
@ghtomcat
ghtomcat / gist:2036528
Created Mar 14, 2012
How to call the Compass API in Phonegap webOS
View gist:2036528
function displayCurrentHeading() {
function successful(response) {
navigator.notification.showBanner('current heading: '+response);
}
var request=navigator.compass.getCurrentHeading(successful,{});
}
You can’t perform that action at this time.