Skip to content

Instantly share code, notes, and snippets.

@thomo
thomo / Sandbox Anleitung.md
Created April 25, 2016 12:36
Anleitung für die Einrichtung einer "Terraforming Sandbox" entsprechend http://idav.ucdavis.edu/~okreylos/ResDev/SARndbox/
  • Terminal Fenster öffnen (Symbol ">_")

  • "./start_sandbox.sh" eingeben -> enter

  • es erscheint ein Fenster "RawKinectViewer"

    • links: "Tiefenbild" der Kinect (eher blau)

    • rechts: Kamarabild der Kinect

    • Ausschnitt des Tiefenbilds vergößern, so dass Sandbox möglichst groß zu sehen ist

@thomo
thomo / user_dht22.lua
Last active April 9, 2016 07:07
DHT22 example (Lua 5.4.1, NodeMCU SDK 1.4.0)
-- pin = 3 -- GPIO0
pin = 4 -- GPIO2
FLOAT_FIRMWARE = (1/3) > 0
function readDht()
status, temp, humi, temp_dec, humi_dec = dht.read(pin)
if status == dht.OK then
if FLOAT_FIRMWARE then
-- Float firmware using this example
@thomo
thomo / pirsensor.rc
Last active January 4, 2016 14:46
initd script to start pir sensor monitor
#!/bin/sh
# chkconfig: 123456 90 10
# Startscript fuer den PIR-Sensor
#
verzeichnis=/usr/local/bin
scriptname=pi-pir.py
start() {
cd $verzeichnis
/usr/bin/python $verzeichnis/$scriptname 2>&1 >> /var/log/pirsensor.log &
@thomo
thomo / pi-pir.py
Last active January 3, 2016 17:21
Raspberry PI - read a PIR sensor
#-------------------------------------------------------------------------------
# Copyright (c) 2015, Thomas Mohaupt <Thomas.Mohaupt@gmail.com>
# All rights reserved.
#
# This is a BSD 2-Clause license,
# see http://opensource.org/licenses/bsd-license.php
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
@thomo
thomo / gist:7785978
Created December 4, 2013 11:16
My Eclipse Favorites
org.hamcrest.core
org.hamcrest.MatcherAssert
org.hamcrest.Matchers
org.mockito.Mockito
@thomo
thomo / matrix.pde
Created July 5, 2013 21:43
Processing example to generate led matrix content and send data via serial line
import processing.serial.*;
// 2D Array of objects
DrawCell[][] grid;
Cell[] buffer;
Serial myPort;
// Number of columns and rows in the grid
int cols = 16;
@thomo
thomo / avr_net_io.ino
Created July 5, 2013 21:40
LED Matrix Arduino program (TLMM501B connected to Pollin AVR NET IO with AVR-NETIO Arduino clone)
int redPin = 0;
int greenPin = 1;
int resetPin = 4;
int selectPin = 5;
int brightPin = 3;
int clockPin = 2;
int offset = 0;
int bufferCol = 0;
#!/usr/bin/env python
import socket
# Set the socket parameters
# avr-netio ip address
host = "10.0.0.52"
# avr-netio port
port = 7777
addr = (host,port)
@thomo
thomo / tcpip.cpp
Created December 22, 2012 14:29
Patched tcpip.cpp file from avr-netino (http://code.google.com/p/avr-netino/) version avr-netino-19Jan2012.zip - add support of receiving udp packets
// IP, Arp, UDP and TCP functions.
// Author: Guido Socher
// Copyright: GPL V2
//
// The TCP implementation uses some size optimisations which are valid
// only if all data can be sent in one single packet. This is however
// not a big limitation for a microcontroller as you will anyhow use
// small web-pages. The web server must send the entire web page in one
// packet. The client "web browser" as implemented here can also receive
// large pages.
@thomo
thomo / avrnetio_udpreceive.ino
Last active December 10, 2015 01:34
This is a demo of receiving udp packets with an avr-netio board, Arduino and avr-netino.
//
// Environment:
// * Pollin AVR NETIO board,
// * Arduino 1.0.3,
// * avr-netino (https://code.google.com/p/avr-netino/)
//
// This is a demo of receiving udp packets
//
// 2012-12-22 <Thomas.Mohaupt@gmail.com> http://creativecommons.org/licenses/by-sa/3.0/
// Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)