Skip to content

Instantly share code, notes, and snippets.

using System.Globalization;
using System.IO;
using System.Text;
namespace DrillBoardGcode
{
class Program
{
static double DRILLDEPTH = -4;
static double DRILLFEED = 5 * 60;
@roboter
roboter / spooldrawer.scad
Created May 7, 2020 15:30
Drawer from empty spool
/* Spool parts storage organizer
Based on https://www.thingiverse.com/thing:2793548 by hirez99
Frank van der Hulst [email protected]
24 Feb 2018
This generates a drawer that can be fitted into an empty filament spool to
provide storage for small parts.
Holes need to be drilled in the sides of the spool for axles
A drill guide is provided to get the axle holes in the right places on the spool.
Axles are provided using tbuser's Pin Connectors V2 library https://www.thingiverse.com/thing:10541
@roboter
roboter / gear.scad
Created May 1, 2020 13:05
OpenSCAD module for simple gears with round teeth
$fn = 50;
color("yellow") rotate(90-$t*360/15) gear(4, 10);
module gear(teeth, step, height=8) {
angle = 360/(teeth*2);
radius = (step/2) / sin(angle/2);
apothem = (step/2) / tan(angle/2);
module circles() {
for (i = [1:teeth])
var lose = 0;
var win = 0;
var total = 0;
while (true)
{
Console.WriteLine("Heads (0) or Tails (1)");
var user = Console.ReadLine();
@roboter
roboter / drawer.scad
Created October 13, 2019 13:43
Spool drawer
/* Spool parts storage organizer
Based on https://www.thingiverse.com/thing:2793548 by hirez99
Frank van der Hulst [email protected]
24 Feb 2018
This generates a drawer that can be fitted into an empty filament spool to
provide storage for small parts.
Holes need to be drilled in the sides of the spool for axles
A drill guide is provided to get the axle holes in the right places on the spool.
Axles are provided using tbuser's Pin Connectors V2 library https://www.thingiverse.com/thing:10541
@roboter
roboter / fastled.cpp
Last active December 12, 2022 17:55
FastLED Example
#include <Arduino.h>
#include <FastLED.h>
#define DATA_PIN 1
#define LED_TYPE WS2812
#define COLOR_ORDER GRB
#define NUM_LEDS 16
CRGB leds[NUM_LEDS];
/* Arduino menu library example
Oct. 2016 Rui Azevedo ([email protected]) www.r-site.net
Digital keypad (3 buttons) using the menu keyIn driver
*/
#include <Arduino.h>
#include <menu.h>
#include <menuIO/serialIn.h>
#include <menuIO/serialOut.h>
@roboter
roboter / mongoose-demo.c
Last active February 13, 2018 18:47
mongooseOS working demo
#include "mgos.h"
#include "mgos_mqtt.h"
static void led_timer_cb(void *arg) {
bool val = mgos_gpio_toggle(mgos_sys_config_get_pins_led());
LOG(LL_INFO, ("%s uptime: %.2lf, RAM: %lu, %lu free", val ? "Tick" : "Tock",
mgos_uptime(), (unsigned long) mgos_get_heap_size(),
(unsigned long) mgos_get_free_heap_size()));
(void) arg;
}
@roboter
roboter / static.ps1
Created January 31, 2018 09:53
Download website with WGET
param([string]$buildFolder)
$jVUNDemo = "$($buildFolder)\jVUNDemo"
$staticSiteParentPath = (get-item $buildFolder).Parent.FullName
$staticSite = "static-site"
$staticSitePath = "$($staticSiteParentPath)\$($staticSite)"
$wgetLogPath = "get.log"
$port = 60345
$servedAt = "http://localhost:$($port)/"
write-host "jVUNDemo location: $jVUNDemo"
public class PrintPos
{
[DllImport("kernel32", SetLastError = true)]
public static extern IntPtr CreateFile(string lpFileName, Int32 dwDesiredAccess, Int32 dwShareMode, IntPtr lpSecurityAttributes, Int32 dwCreationDisposition, Int32 dwFlagsAndAttributes, IntPtr hTemplateFile);
public const Int32 FILE_ATTRIBUTE_NORMAL = 128;//Intializing Port Attributes
public const Int32 INVALID_HANDLE_VALUE = -1;
public const Int32 GENERIC_READ = -2147483648;
public const Int32 GENERIC_WRITE = 1073741824;
public const Int32 CREATE_NEW = 1;