Skip to content

Instantly share code, notes, and snippets.

"""
@package
Output: CSV (comma-separated)
Grouped By: Value
Sorted By: Ref
Fields: Comment,Designator,Footprint,LCSC
Outputs the BOM for JLCPCB. Run this AFTER generating your POS file for SMT assembly.
Attempts to find and modify POS header to JLC format in the same output folder.
@joshua-8
joshua-8 / derivslim.pde
Last active February 14, 2023 23:12
motion profile with limited velocity and acceleration (trapezoidal velocity)
/*
This program is for testing code that can be used to limit the first and second derivative of a variable as it approaches a target value.
It's easiest to think of in terms of position, velocity, and acceleration. If used with a servo, for example, the servo would smoothly move to a target value with a trapezoidal velocity profile.
The formula in this program supports being run at uneven intervals, and allows for editing the target, position, and velocity while it runs
Arduino library I wrote using the algoritihm developed here: https://github.com/joshua-8/Derivs_Limiter
The code was rewritten for version 3 of Derivs_Limiter (supporting different accel from decel and velocity target mode) in June 2022 by joshua-8
*/
@todbot
todbot / trinket_dotstar_test.ino
Last active July 25, 2022 14:45
Simple test of built-in DotStar on Trinket M0 (based on MIDI2Host code)
/*
* MIDIHost2Host -- Connect two USB-MIDI host devices together
* 2019 @todbot / Tod E. Kurt
*
* This sketch is meant to be installed on two Adafruit Trinket M0s.
* The connections between the two Trinket M0s are:
* - TrinketA Gnd --------------------- TrinketB Gnd
* - TrinketA pin 3 --- 1k resistor -- TrinketB pin 4
* - TrinketA pin 4 --- 1k resistor -- TrinketB pin 3
*
@arturo182
arturo182 / bom2grouped_csv_jlcpcb.xsl
Last active June 14, 2024 08:32
A KiCad BOM script for generating JLCPCB PCBA-compatible files!
<!--XSL style sheet to convert EESCHEMA XML Partlist Format to grouped CSV BOM Format
Copyright (C) 2014, Wolf Walter.
Copyright (C) 2013, Stefan Helmert.
Copyright (C) 2018, Kicad developers.
Copyright (C) 2019, arturo182.
GPL v2.
Functionality:
Generation of JLCPCB PCBA compatible BOM
@manuelbl
manuelbl / README.md
Created August 3, 2019 09:12
ESP32 as Bluetooth Keyboard

ESP32 as Bluetooth Keyboard

With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.

For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.

In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone:

  1. Go to your computers/phones settings
  2. Ensure Bluetooth is turned on
@nonsintetic
nonsintetic / ArduinoZeroTimer.ino
Last active April 1, 2024 11:52
SAMD21 Arduino Timer Example
/*
* This sketch illustrates how to set a timer on an SAMD21 based board in Arduino (Feather M0, Arduino Zero should work)
* It should generate a 1Hz square wave as it is (thanks richdrich for the suggestion)
* Some more info about Timer Counter works can be found in this article:
* http://www.lucadavidian.com/2017/08/08/arduino-m0-pro-il-sistema-di-clock/
* and in the datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/SAM_D21_DA1_Family_DataSheet_DS40001882F.pdf
*/
uint32_t sampleRate = 1000; //sample rate in milliseconds, determines how often TC5_Handler is called
@jdneo
jdneo / timerInterrupt.ino
Created December 8, 2016 02:21
Timer Interrupt example for Adafruit Feather M0. Callback function can be written in TC3_Handler().
#define LED_PIN 13
#define CPU_HZ 48000000
#define TIMER_PRESCALER_DIV 1024
void startTimer(int frequencyHz);
void setTimerFrequency(int frequencyHz);
void TC3_Handler();
bool isLEDOn = false;
@atduskgreg
atduskgreg / PWindow.pde
Last active November 15, 2023 13:29
Example of creating a Processing sketch with multiple windows (works in Processing 3.0)
class PWindow extends PApplet {
PWindow() {
super();
PApplet.runSketch(new String[] {this.getClass().getSimpleName()}, this);
}
void settings() {
size(500, 200);
}
@pklaus
pklaus / remove-orphaned-raw-images.py
Last active May 8, 2023 20:43
Do you own a DSLR? If so, do you transfer your images to your computer, then look at the JPEGs and delete the crappy ones? If you do, your RAW images may be leftover. This Python script helps you cleaning up your image folders after deleting unwanted JPEGs. See http://blog.philippklaus.de/2012/12/cleaning-leftover-raw-images-after-selecting-imag…
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
This script was moved to
https://github.com/pklaus/pklaus/blob/master/pklaus/images/orphans/remove.py
Here's the original content left for you as a reference:
Do you own a DSLR? If so, do you transfer your images to your computer,
then look at the JPEGs and delete the crappy ones? If you do, your RAW