Skip to content

Instantly share code, notes, and snippets.

@hsiboy
hsiboy / wiegand.c
Created March 17, 2014 12:59
Wiegand API for Raspberry Pi
/*
* Wiegand API Raspberry Pi
* By Kyle Mallory All rights reserved.
* 12/01/2013
* Based on previous code by Daniel Smith (www.pagemac.com) and Ben Kent (www.pidoorman.com)
* Depends on the wiringPi library by Gordon Henterson: https://projects.drogon.net/raspberry-pi/wiringpi/
*
* This is linked with -lpthread -lwiringPi -lrt
*
* The Wiegand interface has two data lines, DATA0 and DATA1. These lines are normall held
@hsiboy
hsiboy / fuses.ino
Created July 13, 2023 16:14
Automated Fuse Tester - for testing automative fuses using an arduino
/*
/ You'll need to adjust the current reading code based on the specific sensitivity of your ACS758 model.
/ Remember to adjust `ACS758_SENSITIVITY` based on the specific ACS758 model you're using.
/ The `readCurrent()` function reads the current sensor output and converts it to current based on the sensor sensitivity.
/
/ It's necessary to map the analog voltage reading based on your specific power source and voltage divider setup.
/ The code provided here assumes a 5V power supply for the Arduino, and that the voltage divider reduces the maximum
/ voltage of 15V to within 0-5V for the ADC. The specifics will depend on the actual resistors used in the voltage divider.
/ The Aref pin is supplied with 4.3v from a preecision zenner diode.
/
@hsiboy
hsiboy / dump1090LCD.py
Created July 5, 2023 10:07
Scrapes the json from dump1090 and pushes the info to an LCD display connected via RS232
import json
import serial
# Configure the serial port
ser = serial.Serial('/dev/ttyUSB0', 9600) # Replace '/dev/ttyUSB0' with the correct serial port and baud rate
# Parse the JSON data from Dump1090
def parse_dump1090_data(json_data):
aircraft_data = json.loads(json_data)
for aircraft in aircraft_data:
@hsiboy
hsiboy / navtex.ino
Created October 8, 2019 22:13
Simple Navtex receiver - https://youtu.be/SwL_ZQ_iBIM
/*
* Simple Navtex receiver - https://youtu.be/SwL_ZQ_iBIM
*
* by Martin Kuettner <berry@fmode.de> 03/2016
*
*
* Porting the 80C51 Assembler Program from "A NAVTEX Receiver for the DXer":
*
* Klaus Betke, Am Entengrund 7, D-26160 Bad Zwischenahn, Email: betke@itap.de
* 11-AUG-00/01-OCT-00
@hsiboy
hsiboy / bounce.ino
Created January 16, 2015 13:46
WS2811 - bounce using FastLed
// stolen from https://github.com/fibonacci162
#include <FastLED.h>
#define LED_PIN 13 // hardware SPI pin SCK
#define NUM_LEDS 250
#define COLOR_ORDER RGB
#define LED_TYPE WS2811
#define MAX_BRIGHTNESS 255 // watch the power!
#define GRAVITY -9.81 // Downward (negative) acceleration of gravity in m/s^2
/*
d8888 .d8888b. 888b 888
d88888 d88P Y88b 8888b 888
d88P888 888 888 88888b 888
.d8888b d88P 888 888 888Y88b 888
88K d88P 888 888 888 Y88b888
"Y8888b. d88P 888 888 888 888 Y88888
X88 d8888888888 Y88b d88P 888 Y8888
88888P' d88P 888 "Y8888P" 888 Y888
xTS25ESYS
RolandEC
[[Section Address:
SONG0000VS2
.
..
SCSI Check..
These are some findings during my trip down the rabbit hole that is a replacement for the Iomega Zip drive in the Roland SP-808 and SP-808ex samplers.
INQUIRY
The INQUIRY command may be used by a host computer to determine the configuration of the ATAPI Block
Device. ATAPI Block Devices respond with information that includes their type and specification level and
may include the vendor’s identification, model number and other useful information.
SP-808 sends "ATAPI INQUIRY", but does not read allocated data and sends "IDENTIFY PACKET DEVICE" next.
TTS25ESYS
RolandEC
@4cj
@4bz
@4.z
msTpj
@4bTp
@4bj)
mvTpm
@4^@
@hsiboy
hsiboy / animation.ino
Created January 9, 2015 16:39
FUNCTION-BASED ANIMATION SEQUENCES FOR WS2812 LED STRIPS Using FastLED library - Author: Dave Morris: http://www.google.com/+DaveMorris128
// FUNCTION-BASED ANIMATION SEQUENCES FOR WS2812 LED STRIPS
// Using FastLED library
// Author: Dave Morris: http://www.google.com/+DaveMorris128
// Version 1.0 (2014-07-31)
//
//
// The following code includes "primitive animations" which are the base effect and
// "aggregate animations" which are combinations of one or more primitive animations
// Feel free to combine different primitives each loop for synergistic results but:
// -If using an aggregate animation make sure your primatives don't clear the buffer each frame (FastLED.clear())