Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
# set nonstandard baudrate.
# based on http://unix.stackexchange.com/a/327366/119298
# this version takes the device file and baudrate as arguments
# and prints an error message if the device file could not be opened.
import sys,os,array,fcntl,argparse
parser = argparse.ArgumentParser()
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define DCSBIOS_IRQ_SERIAL
#include <DcsBios.h>
#include <Servo.h>
@jboecker
jboecker / Vid60StepperExample.ino
Last active May 19, 2023 10:05
Vid60 stepper support for DCS-BIOS
#define DCSBIOS_IRQ_SERIAL
#include <AccelStepper.h>
#include "DcsBios.h"
struct StepperConfig {
unsigned int maxSteps;
unsigned int acceleration;
unsigned int maxSpeed;
};
#define DCSBIOS_IRQ_SERIAL
#include "DcsBios.h"
#include "LedControl.h"
LedControl lc=LedControl(2,3,4,1);
void onUv26DisplayChange(char* newValue) {
/* set digit 4 to first character (newValue[0]) */
@jboecker
jboecker / MAX7219SegmentId.ino
Created November 25, 2016 18:31
This is a simple example sketch to test a 7-Segment display driven by a MAX7219 chip.
#include "LedControl.h"
// modified LCDemo7Segment example from the LedControl library
/*
pin 2 = DataIn
pin 3 = CLK
pin 4 = LOAD
1 = Anzahl hintereinandergeschalteter MAX7219-Chips
*/
local witchcraft = {}
witchcraft.host = "localhost"
witchcraft.port = 3401
local require = require
local loadfile = loadfile
package.path = package.path..";.\\LuaSocket\\?.lua"
package.cpath = package.cpath..";.\\LuaSocket\\?.dll"
local JSON = loadfile("Scripts\\JSON.lua")()
#!/usr/bin/env python3
"""
Python3 script to manage an external Lenovo LT1423p monitor
Requirements: xrandr, wmctrl, displaylink service
"""
LAPTOP_WACOM_DEVICES=[
"Wacom Serial Penabled 1FG Touchscreen stylus",
"Wacom Serial Penabled 1FG Touchscreen eraser"
]
@jboecker
jboecker / WitchcraftServerEnv.lua
Created February 26, 2015 16:49
DCS Witchcraft adapted to the DCS "server" Lua environment (e.g. by commenting out env.info() calls)
--[[
Setup of on_process() function taken from the excellent example set by SLMod
]] --
log("Loading Witchcraft into the server environment...")
witchcraft = witchcraft or {}
witchcraft.oldfunc = {}
witchcraft.oldfunc.on_process = server.on_process()
/*
Connections:
CLOCK: Pin 2 (interrupt 0)
LOAD: Pin 3 (interrupt 1)
DATA IN: Pin 4
This sketch emulates the SPI interface of the
MAX7219 chip and constantly prints the values
of the internal 16 registers to the serial
/* PS2Keyboard library example
Adapted to control (parts of) the A-10C CDU keyboard
through DCS-BIOS.
PS2Keyboard now requries both pins specified for begin()
keyboard.begin(data_pin, irq_pin);
Valid irq pins: