Skip to content

Instantly share code, notes, and snippets.

@kk6axq
kk6axq / upload_bl_and_app.bash
Created September 1, 2025 22:48
Combined bootloader and application flashing for PX4
#!/bin/bash
# This bash script takes a bootloader and application PX4 image and combines them together, then flashes them over DFU to an attached target
BOOT=build/target_name_bootloader/target_name_bootloader.bin
FW=build/target_name_default/target_name_default.bin
OUT=build/full_image.bin
APP_LOAD_ADDR=0x08020000 # This may be different for you, check the APP_LOAD_ADDRESS define for your target
FLASH_SIZE=$((2048 * 1024)) # 2 MB in bytes, change this for your target
# Compute sizes
@kk6axq
kk6axq / scanner_input.py
Created September 4, 2024 03:59
Remap ASCII record codes for USB barcode scanner
"""
Some barcodes have ASCII control codes for record separator, group separator, or end of transaction.
On a cheap USB barcode scanner, these usually are just entered as the ASCII characters, and some software can't parse this.
I wanted to scan into Partsbox, but it only supports {RS}, {GS}, and {EOT} instead of the respective ASCII characters.
Since my barcode scanner couldn't support doing this internally, I put it in serial mode and parsed those myself.
This program (thanks to ChatGPT) remaps those characters and uses the PyUserInput library to type the code on the keyboard.
"""
import serial
from pykeyboard import PyKeyboard
@kk6axq
kk6axq / eepromI2C.c
Last active March 24, 2023 17:22 — forked from icaroj/eepromI2C.c
XC16 functions to replicate the example API provided by Microchip for an MSSP I2C module.
/*
* File: eepromI2C.c
* Author: Icaro J.
*
* Created on 20 de Janeiro de 2017, 15:30
* Modified by Lukas Severinghaus, 21 March 2023
* Summary: Modified functions to take 7 bit addresses, and replicate API provided by Microchip examples.
*/
@kk6axq
kk6axq / SerialHelper.py
Created June 22, 2022 03:12
PyNMEA2 Improved Parsing Class
'''
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
@kk6axq
kk6axq / 4-26-17 Turtlebot Calibration Output.txt
Created April 27, 2017 00:12
Turtlebot Calibration Output
lukas@lukas-master:/opt/ros/indigo/share/turtlebot_calibration/launch$ roslaunch calibrate.launch
... logging to /home/lukas/.ros/log/4ed25720-2adb-11e7-b87d-001e06302461/roslaunch-lukas-master-7719.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://192.168.1.2:51744/
SUMMARY
========
@kk6axq
kk6axq / install.sh
Created October 1, 2016 19:29
setup files
#!/usr/bin/env sh
#Here you need to adjust your ROS Hostname and Master URI to the appropriate values.
cd ~/
mkdir -p Wheelchair_WS/src
cd Wheelchair_WS/src
catkin_create_workspace
cd ../
catkin_make
echo "source /home/odroid/Wheelchair_WS/devel/setup.bash" >> ~/.bashrc
cd src
#!/usr/bin/env python
'''
*****************************************
pythonToArduino.ino
Created October 1, 2016
Adapted from the Simple Subscriber example from the ROS wiki
which is licensed under the Createive Commons Attribution 3.0 License.
A copy of the license can be found here: https://creativecommons.org/licenses/by/3.0/legalcode
Modified By: thecentralthinkingunit.blogspot.com
Released into the public domain.
@kk6axq
kk6axq / arduinoToPython.ino
Created October 1, 2016 01:25
Main Mega controller code.
/*****************************************
* ArduinoToPython.ino
* Created September 16, 2016
* Author: thecentralthinkingunit.blogspot.com
* Purpose:
* This program establishes a basic one way serial communications protocol.
* The computer sends the byte 0x41 to begin a packet.
* Then it sends two bytes, the first for the linear and the second for the linear. They must have a range from 0x00 to 0xB4(0-180 decimal)
* There is nothing to end a packet. This may be a good feature to add in the future.
******************************************/
@kk6axq
kk6axq / arduinoFailsafe.ino
Created October 1, 2016 01:24
Failsafe Controller
/*****************************************
ArduinoFailsafe.ino
Created September 17, 2016
Adapted from the State Change Example by Tom Igoe
which was released into the public domain
Modified By: thecentralthinkingunit.blogspot.com
Released into the public domain
Purpose:
This program acts as a failsafe for the robot.
It sends 0xFF to a serial device(Xbee) when the button is pressed.