Skip to content

Instantly share code, notes, and snippets.

View rosterloh's full-sized avatar

Richard Osterloh rosterloh

View GitHub Profile
@rosterloh
rosterloh / getopts.sh
Created June 2, 2014 16:07
An example of how to use bash getopts
#!/bin/bash
######################################################################
#This is an example of using getopts in Bash. It also contains some
#other bits of code I find useful.
#Author: Linerd
#Website: http://tuxtweaks.com/
#Copyright 2014
#License: Creative Commons Attribution-ShareAlike 4.0
#http://creativecommons.org/licenses/by-sa/4.0/legalcode
@rosterloh
rosterloh / m5cam.yaml
Last active November 4, 2023 10:41
ESPHome for m5cam
esphome:
name: m5cam
platform: ESP32
board: m5stack-core-esp32
wifi:
ssid: "ssid"
password: "password"
# Enable logging
@rosterloh
rosterloh / help.log
Created May 6, 2023 16:29
ROS Iron testing for #829
rosterloh@gardinbot:~$ ros2 -h
usage: ros2 [-h] [--use-python-default-buffering] Call `ros2 <command> -h` for more detailed usage. ...
ros2 is an extensible command-line tool for ROS 2.
options:
-h, --help show this help message and exit
--use-python-default-buffering
Do not force line buffering in stdout and instead use the python default buffering, which might be affected by PYTHONUNBUFFERED/-u and depends on whatever stdout is interactive or not
@rosterloh
rosterloh / index.yaml
Last active February 14, 2023 07:54
Mixin to optimise builds for Raspberry Pi 4
mixin:
- tune-pi4.mixin
@rosterloh
rosterloh / gpio.java
Created August 18, 2014 13:40
Android class for GPIO control
public class GPIO {
public String port;
public int pin;
//get direction of gpio
public String getInOut()
{
String command = String.format("cat /sys/class/gpio/%s/direction",this.port);
try {
@rosterloh
rosterloh / template.c
Created January 11, 2014 20:00
C source file templates from beningo.com
/*******************************************************************************
* Title : System Initialization
* Filename : sys_init.c
* Author : JWB
* Origin Date : 04/23/2012
* Version : 1.0.0
* Compiler : Microchip C30 v3.30c
* Target : PIC24FJ64GB004
* Notes : None
*******************************************************************************/
@rosterloh
rosterloh / test.py
Last active September 21, 2021 09:43
Cli application to test dynamixel servos
import atexit
import argparse
from datetime import datetime, timedelta
from dynamixel_sdk import PortHandler
from dynamixel_sdk.robotis_def import COMM_SUCCESS
from dynamixel_sdk.packet_handler import PacketHandler
import logging
from logging.handlers import TimedRotatingFileHandler
import os
import sys
@rosterloh
rosterloh / Control.srv
Last active July 29, 2021 08:54
MicroROS zephyr demo
uint8 module # module to control
uint8 command # value to set
---
bool success # indicate successful run of triggered service
import cv2
import numpy as np
from datetime import datetime
import array
import fcntl
import os
import argparse
from utils import ArducamUtils
import Jetson.GPIO as GPIO
from time import sleep
@rosterloh
rosterloh / boot.py
Created May 28, 2019 15:49
CircuitPlayground Express Current Logger
# boot.py
# Set Circuit Playground Express flash chip to program writeable
# If toggle switch is right,
# flash is program writeable and file access is frozen
# If toggle switch is left,
# flash chip file access ok, file writes give an error
# via Dan Conley
# https://learn.adafruit.com/cpu-temperature-logging-with-circuit-python/
# writing-to-the-filesystem
# 2018 Mike Barela for Getting Started with Circuit Playground Express