Skip to content

Instantly share code, notes, and snippets.

View s-light's full-sized avatar
🌞
happy

Stefan Krüger s-light

🌞
happy
View GitHub Profile
@s-light
s-light / RFID.ino
Created June 1, 2022 14:43
example for 125kHz RFID reader RDM6300 → save both files as one sketch.
const int BUFFER_SIZE = 14; // RFID DATA FRAME FORMAT: 1byte head (value: 2), 10byte data (2byte version + 8byte tag), 2byte checksum, 1byte tail (value: 3)
const int DATA_SIZE = 10; // 10byte data (2byte version + 8byte tag)
const int DATA_VERSION_SIZE = 2; // 2byte version (actual meaning of these two bytes may vary)
const int DATA_TAG_SIZE = 8; // 8byte tag
const int CHECKSUM_SIZE = 2; // 2byte checksum
uint8_t buffer[BUFFER_SIZE]; // used to store an incoming data frame
int buffer_index = 0;
@s-light
s-light / LiquidCrystal_PCF8574__HelloWorld.ino
Last active June 1, 2022 14:21
Arduino LiquidCrystal_PCF8574 test sketches
#include <LiquidCrystal_PCF8574.h>
#include <Wire.h>
// LiquidCrystal_PCF8574 lcd(LCD_ADDRESS); → Default = 0x27;
LiquidCrystal_PCF8574 lcd(0x27);
void setup() {
Serial.begin(115200);
Serial.println("LiquidCrystal_PCF8574__HelloWorld");
@s-light
s-light / neopixel_minimal_test.py
Last active July 3, 2020 06:59
minimal test for NeoPixels with Linux / CircuitPython
# minimal test for NeoPixels on Raspberry Pi
import time
import board
import neopixel
num_pixels = 2
pixels = neopixel.NeoPixel(
board.D18,
@s-light
s-light / rmv_query_link.js
Last active April 4, 2019 13:50
Greasmonkey - rmv.de add link button for search query
@s-light
s-light / readme.md
Last active January 12, 2019 17:36
make-munich cfm mods...
@s-light
s-light / helper.js
Created April 11, 2018 18:24
replace in all text nodes (html dom javascript)
function replace_in_textnodes(search_string, replace_string) {
console.group('replace_in_pre');
// based on: https://stackoverflow.com/a/10730777/574981
const walk = document.createTreeWalker(
document,
NodeFilter.SHOW_TEXT,
null,
false
);
let replace_counter = 0;
@s-light
s-light / AvahiDiscoveryAgent.cpp
Created March 25, 2018 16:01
olad log with timestamp on emulated arm (qemu chroot)
AvahiDiscoveryAgent::AvahiDiscoveryAgent()
: m_threaded_poll(avahi_threaded_poll_new()),
m_client(NULL),
m_reconnect_timeout(NULL),
m_backoff(new ExponentialBackoffPolicy(TimeInterval(10, 0),
TimeInterval(600, 0))) {
}
@s-light
s-light / AvahiDiscoveryAgent.cpp
Created March 25, 2018 15:51
olad log with timestamp on emulated arm (qemu chroot)
// LINE124..
AvahiDiscoveryAgent::AvahiDiscoveryAgent()
: m_threaded_poll(avahi_threaded_poll_new()),
m_client(NULL),
m_reconnect_timeout(NULL),
m_backoff(new ExponentialBackoffPolicy(TimeInterval(10000000, 0),
TimeInterval(600000000, 0))) {
}
@s-light
s-light / olad log with timestamps
Last active January 27, 2018 11:25
running olad in qemu-arm-static chroot
light@stefan-Latitude-E6510:~/ola (APA102PixelBrightness)$ ./olad/olad -l4 2>&1 | ts "%H:%M:%.S"
12:24:31.007285 olad/Olad.cpp:94: OLA Daemon version 0.10.6
12:24:31.019336 common/io/EPoller.cpp:82: EPOLL_CTL_ADD 5, events 2001, descriptor: 0x42388
12:24:31.019652 olad/OlaDaemon.cpp:121: Using configs in /home/light/.ola
12:24:31.019917 common/io/EPoller.cpp:82: EPOLL_CTL_ADD 8, events 2001, descriptor: 0x3bd48
12:24:31.020256 common/thread/Thread.cpp:194: Thread pref-saver, policy SCHED_OTHER, priority 0
12:24:31.671773 common/rdm/PidStoreLoader.cpp:271: Loading DISC_UNIQUE_BRANCH
12:24:31.672430 common/rdm/PidStoreLoader.cpp:271: Loading DISC_MUTE
12:24:31.672842 common/rdm/PidStoreLoader.cpp:271: Loading DISC_UN_MUTE
12:24:31.673146 common/rdm/PidStoreLoader.cpp:271: Loading PROXIED_DEVICES
@s-light
s-light / olad log with TimeInterval*1000
Created January 22, 2018 15:20
running olad in qemu-arm-static chroot - mod
light@stefan-Latitude-E6510:~/ola (AvahiTest *)$ date; ./olad/olad -l4; date
Mon Jan 22 16:19:57 CET 2018
olad/Olad.cpp:94: OLA Daemon version 0.10.5
common/io/EPoller.cpp:82: EPOLL_CTL_ADD 5, events 2001, descriptor: 0x42388
olad/OlaDaemon.cpp:121: Using configs in /home/light/.ola
common/io/EPoller.cpp:82: EPOLL_CTL_ADD 8, events 2001, descriptor: 0x3bd48
common/thread/Thread.cpp:194: Thread pref-saver, policy SCHED_OTHER, priority 0
common/rdm/PidStoreLoader.cpp:271: Loading DISC_UNIQUE_BRANCH
common/rdm/PidStoreLoader.cpp:271: Loading DISC_MUTE
common/rdm/PidStoreLoader.cpp:271: Loading DISC_UN_MUTE