This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import glob | |
import serial | |
import math | |
DEBUG_PRINT = 0 | |
data_backup = [-1, 1,1,1, 1,1,1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// visualization tool: | |
// https://leomcelroy.com/svg-pcb/?file=https://gist.githubusercontent.com/honnet/735785331add65ea58daa274873922e5/raw/generative_stm32_pcb.js | |
const STM32 = {"A2":{"pos":[-0.005964566929133858,0.0172244094488189],"shape":"M 0.004 0 L 0.003997563308076383 0.00013959798681000387 L 0.0039902562010392965 0.00027902589497650124 L 0.003978087581473094 0.0004181138530706139 L 0.003961072274966282 0.0005566924038402618 L 0.003939231012048832 0.0006945927106677213 L 0.003912590402935223 0.0008316467632710374 L 0.003881182905103986 0.0009676875823986709 L 0.003845046783753276 0.0011025494232679966 L 0.0038042260651806143 0.0012360679774997896 L 0.003758770483143634 0.001368080573302675 L 0.00370873541826715 0.0014984263736636482 L 0.0036541818305704035 0.001626946572303201 L 0.003595176185196668 0.0017534845871563097 L 0.003531790371435708 0.0018778862511435632 L 0.0034641016151377548 0.0019999999999999996 L 0.0033921923846257037 0.0021196770569328195 L 0.0033161502902201664 0.002236771613882987 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// visualization tool: https://leomcelroy.com/svg-pcb/ | |
// source: https://gist.github.com/honnet/b411a1dbd15822b05d94e6c59652bcac | |
/* -- DECLARE_COMPONENTS -- */ | |
const test_footprint = { | |
"VCC": { | |
"shape": "M -0.05 0.025L 0.05 0.025L 0.05 -0.025L -0.05 -0.025L -0.05 0.025", | |
"pos":[-0.1,0.05], | |
"layers":["F.Cu"] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://leomcelroy.com/svg-pcb/?file=https://gist.githubusercontent.com/honnet/99db74cb50a125d0d0a9bc922703f8cf/raw/LED_strip_SK6805-EC15.js | |
////////////////////////// | |
const LED_num = 15; | |
const size_y = 0.1; | |
const is_pad_export = 0; | |
////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://leomcelroy.com/svg-pcb/?file=https://gist.githubusercontent.com/honnet/55a3bd744e1ca6b1f4440f56299bd329/raw/395cfd3da69157746fa1be8f417188c5a02d24d7/attiny20_test.js | |
// temporary bug fix (pad diameter VS radius confusion): | |
const ATtiny20 = (() => { return kicadToObj( | |
`(module WLCSP-12_1.403x1.555mm_P0.4mm_Stagger (layer F.Cu) (tedit 5C18324B) | |
(descr "WLCSP-12, 6x4 raster staggered array, 1.403x1.555mm package, pitch 0.4mm; http://ww1.microchip.com/downloads/en/devicedoc/atmel-8235-8-bit-avr-microcontroller-attiny20_datasheet.pdf#page=208") | |
(tags "CSP 12 0.2x0.346333") | |
(attr smd) | |
(solder_mask_margin 0.0325) | |
(solder_paste_margin 0.000001) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inspiration: https://www.christidis.info/index.php/personal-projects/arduino-nikon-infrared-command-code | |
const int LEDpin = D3; | |
const int delay_us = 13; // 38 KHz | |
int i; | |
void setup() { | |
pinMode(LEDpin, OUTPUT); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ADCTouch.h> | |
// ADCTouch can be installed in the library manager | |
// Procedure explained in https://www.arduino.cc/en/Guide/Libraries#toc3 | |
int ref0; // reference values to remove offset | |
bool toggle = 0; | |
bool old_touch_state = 0; | |
void setup() { | |
Serial.begin(115200*2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int led_pin = LED_BUILTIN; | |
void setup() { | |
pinMode(led_pin, OUTPUT); | |
digitalWrite(led_pin, LOW); | |
Serial.begin(115200); | |
Serial.println("hello!"); | |
} |