Skip to content

Instantly share code, notes, and snippets.

module tube(height, radius, wall, center = false) {
difference() {
cylinder(h=height, r=radius, center=center);
translate([0,0,-1]) cylinder(h=height + 2, r=radius- wall, center=center);
}
}
for(k=[0: 20.5: 300]) {
P = k / 300.0;
#include <dht11.h>
#include <MQ135.h>
// #include <Adafruit_NeoPixel.h>
// #include "FastLED.h"
#define DHT11_PIN 4
dht11 DHT;
MQ135 MQ(A0);
@possan
possan / dotstardisk-clcok.ino
Created September 3, 2015 21:40
A simple clock for the dotstar disk by adafruit https://www.adafruit.com/products/2477
#include <EEPROM.h>
#include <Adafruit_DotStar.h>
#include <SPI.h>
#include "TimerThree.h"
// R0 = 4x12 leds
// R1 = 4x11 leds
// R2 = 4x10 leds
// R3 = 4x9 leds
@possan
possan / rotozoom.cob
Created August 19, 2015 22:25
VT100 Rotozoomer in Cobol
IDENTIFICATION DIVISION.
PROGRAM-ID. ROTOZOOM.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 DUMMY PIC 9(1) BINARY VALUE 0.
01 FRAME PIC 9(10) VALUE 0.
01 WS-CNT PIC 9(3) VALUE 0.
01 WS-CNT2 PIC 9(3) VALUE 0.
01 TMP PIC 9(3) VALUE 0.
@possan
possan / gltest.m
Created February 25, 2015 22:06
Minimal OpenGL Shader example
//
// Minimal self container OpenGL Example
//
// Compile with:
// xcrun gcc -o test -framework Foundation -framework OpenGL -framework CoreGraphics -framework AppKit main.m
//
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <OpenGL/OpenGL.h>
@possan
possan / gltest.m
Last active August 29, 2015 14:16
Minimal self container OpenGL Example on OSX
//
// Minimal self container OpenGL Example
//
// Compile with:
// xcrun gcc -o test -framework Foundation -framework OpenGL -framework CoreGraphics -framework AppKit main.m
//
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <OpenGL/OpenGL.h>
var SerialPort = require("serialport");
var moment = require('moment');
// https://github.com/tompreston/4x5-Font/blob/master/4x5-font.js
var font4x5 = {
'': [0x0, 0x0, 0x0, 0x0, 0x0],
'!': [0x4, 0x4, 0x4, 0x0, 0x4],
'#': [0x6, 0xf, 0x6, 0xf, 0x6],
'\'': [0x0, 0xa, 0x0, 0x0, 0x0],
'%': [0x7, 0xe, 0x4, 0x7, 0xe],
@possan
possan / ledpanel.ino
Created September 10, 2014 22:22
64x32 ledpanel driver
// PINS
// OE A
// - B
// - -
// - CLK
// - SCLK
// - -
// - R
// - -
@possan
possan / ledpanel.js
Created September 10, 2014 22:22
64x32 ledpanel driver for node.js
var SerialPort = require("serialport");
// https://github.com/tompreston/4x5-Font/blob/master/4x5-font.js
var font4x5 = {
'': [0x0, 0x0, 0x0, 0x0, 0x0],
'!': [0x4, 0x4, 0x4, 0x0, 0x4],
'#': [0x6, 0xf, 0x6, 0xf, 0x6],
'\'': [0x0, 0xa, 0x0, 0x0, 0x0],
'%': [0x7, 0xe, 0x4, 0x7, 0xe],
'$': [0x7, 0xa, 0x6, 0x5, 0xe],
@possan
possan / stick.ino
Created September 9, 2014 21:31
Simple arcade stick controller thingy for Arduino, emulating an keyboard, sending arrow key events
const int leftButton = 4;
const int rightButton = 5;
const int upButton = 6;
const int downButton = 3;
const int enterButton = 7;
const int ledPin = 12;
class Debouncer {
private:
int time;