Skip to content

Instantly share code, notes, and snippets.

@dragonlock2
dragonlock2 / light_to_tfrecord.py
Created August 19, 2019 09:44
Converts LabelImg files to TFRecord
import tensorflow as tf
import os
from lxml import etree
from tf.models.research.object_detection.utils import dataset_util
from tf.models.research.object_detection.utils import label_map_util
flags = tf.app.flags
flags.DEFINE_string('annotations', '', 'Path to LabelImg XMLs')
flags.DEFINE_string('pbtxt', '', 'pbtxt mapping id to name')
@dragonlock2
dragonlock2 / Constants.h
Created August 19, 2019 22:37
Code for Nunchuk remote
//RGB setup
#define R 9 //all are pwm pins
#define G 6
#define B 5
//RF24 stuff
#define RF24_INT 3 //INT1
#define RF24_CE 7
#define RF24_CSN 10
@dragonlock2
dragonlock2 / RF24.c
Created August 20, 2019 08:42
RF24 library for Atmel Studio 7
/*
* RF24.c
*
* Adapted from TMRh20's RF24 library
*
* Created: 7/3/2019 1:53:45 AM
* Author: MatthewTran
*/
#include <clock_config.h>
@dragonlock2
dragonlock2 / PCB_Laminator_v1.5.ino
Created August 23, 2019 05:28
Code powering my PCB Laminator
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Servo.h>
#include <Encoder.h>
#include <PID_v1.h>
//display stuff
#define FRAME_RATE 130 //in ms, takes about 112ms actually
#define SCREEN_WIDTH 128 // OLED display width, in pixels
@dragonlock2
dragonlock2 / main.c
Created August 28, 2019 20:53
STM32 Keypad Main Code
/**
******************************************************************************
* @file : main.c
* @brief : Main program body
******************************************************************************
* This notice applies to any and all portions of this file
* that are not between comment pairs USER CODE BEGIN and
* USER CODE END. Other portions of this file, whether
* inserted by the user or by software development tools
* are owned by their respective copyright owners.
@dragonlock2
dragonlock2 / Reflow_v1.ino
Created August 29, 2019 22:31
Code for my Reflow oven.
#include "max6675.h"
#include <LiquidCrystal.h>
#include <PID_v1.h>
//profiles
const int NUM_PROFILES = 2;
const int NUM_POINTS = 5;
String profiles[] = {"Lead (Sn63 Pb37)",
"Lead-free SAC305",
"Manual Control "}; //16 char long
@dragonlock2
dragonlock2 / Lightsaber_v4.ino
Created September 1, 2019 03:21
Code for my 4th gen Arduino based lightsaber.
#include <TMRpcm.h>
#include <SdFat.h>
//#include <CapacitiveSensor.h>
File file;
SdFat SD;
TMRpcm audio;
//CapacitiveSensor top = CapacitiveSensor(A0, A1); //20M resistor between, antenna on A1
@dragonlock2
dragonlock2 / MP_v3.ino
Created September 2, 2019 00:55
Code for my device for Science Olympiad Mission Possible 2018.
/*
* MP_v3 code
* written by: Matthew Tran
* version: 051318
*/
//input
//#define BALLOON
//#define IR_IN
//#define PELT_IN
@dragonlock2
dragonlock2 / Lightsaber_v3.ino
Created September 30, 2019 07:12
Code for my lightsaber v3.
#include <TMRpcm.h> //audio libs
#include <SPI.h>
#include <SdFat.h>
#include "I2Cdev.h" //gyro libs
#include "MPU6050.h"
#include "Wire.h"
SdFat sd;
File file;
@dragonlock2
dragonlock2 / resume.sty
Created September 21, 2020 08:24
My LaTeX resume template
% Original template by Abhinay Korukonda
% Heavily modified by Matthew Tran
%%% PACKAGES
% Used for scaling
\usepackage{relsize}
% Font
\usepackage{tgpagella}
% Microtyping, apparently makes things look better