Skip to content

Instantly share code, notes, and snippets.

View mattrude's full-sized avatar

Matt Rude mattrude

View GitHub Profile
@mattrude
mattrude / PIC16F15214-stoplight.c
Last active February 5, 2022 09:13
PIC16F15214 - A simple program that simulates a standard traffic stop light with 3 LEDs.
/* File: PIC16F15214-stoplight.c
* Hardware: PIC16F15214
* Build software: MPLAB X IDE v6.00 & XC8 v2.32
* Author: Matt Rude <matt@mattrude.com>
* Created on February 3, 2022, 1:11 AM
*
* ----------------------------------------------------------------------------
* Description:
*
* A simple program that simulates a standard traffic stop light with 6 LEDs.
@mattrude
mattrude / PIC16F877A_KnightRider_scanner.c
Last active February 6, 2022 18:28
PIC16F877A - Knight Rider scanner bar
/*
* File: KnightRider.c
* Author: Matt Rude <matt@mattrude.com>
*
* Created on February 4, 2022, 6:33 PM
*/
#define _XTAL_FREQ 4000000
#pragma config FOSC = HS
#!/bin/python
# Python code for writing eeprom data to a 25AA128
data = bytearray([
# Set ABP Byte (1-byte)
0x01,
# TTN Device Address, 4 Bytes, MSB
0xCB, 0x4B, 0xCC, 0x18, # devaddr
@mattrude
mattrude / 6502.md
Last active December 6, 2021 23:14

First start by installing the needed software on your computer.

apt -y install build-essential pkg-config git libusb-1.0-0-dev

Next download, compile, & install the minipro software

cd &amp;&amp; rm -rf minipro
@mattrude
mattrude / frequency-plans.yml
Created June 28, 2021 18:18
The Things Network frequency-plans.yml file
- id: US_902_928_FSB_2
name: United States 902-928 MHz, FSB 2 (Default, use this one)
description: The Community Network frequency plan for the United States and Canada, using sub-band 2
base-frequency: 915
country-codes: [ca, cr, ec, gy, mx, pa, pr, us]
file: US_902_928_FSB_2.yml
- id: US_902_928_FSB_1
name: United States 902-928 MHz, FSB 1
description: Default frequency plan for the United States and Canada, using sub-band 1
@mattrude
mattrude / global_conf.json
Created June 10, 2021 20:17
The global_conf.json for TTN Stack
{
"SX1301_conf": {
"lorawan_public": true,
"clksrc": 1,
"antenna_gain": 0,
"radio_0": {
"enable": true,
"type": "SX1257",
"freq": 904300000,
"rssi_offset": -166.0,
@mattrude
mattrude / traccar-v2.php
Last active February 9, 2021 04:21
A helper file to transmit locations from TheThingsNetwork to Traccar
<?php
$json = file_get_contents('php://input');
$data = json_decode($json, true);
$id = $data["dev_id"];
$lat = $data["payload_fields"]["latitude"];
$lon = $data["payload_fields"]["longitude"];
$altitude = $data["payload_fields"]["altitude"];

To run:

curl -Ls "https://gist.githubusercontent.com/mattrude/4195d155c5deb53b628055a5f83fd5e3/raw/raspi-build.sh" |sh -
@mattrude
mattrude / cloudflare-zone-updater.sh
Last active September 5, 2020 02:52
Cloudflare Zone Updater
#!/bin/bash
Host="lora"
Domain="theodin.network"
User="<--Cloudflare-Username-->"
Key="<--Cloudflare-API-Key-->"
###############################################################################################
Missing=''
@mattrude
mattrude / LHT65-chirpstack-decoder.js
Last active September 3, 2021 17:38
TTN or ChirpStack Payload Decode Codec for the Dragino LHT65 Remote Sensor
/*
* ChirpStack Payload Decode Codec for the Dragino LHT65 Remote Sensor
* Version 0.1.0 - 2020-08-14 - Matt Rude <matt@mattrude.com>
*
* *******************************************************************************
*
* Copyright (c) 2020 Matt Rude <matt@mattrude.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal