Skip to content

Instantly share code, notes, and snippets.

View wlmeng11's full-sized avatar
🐧

William Meng wlmeng11

🐧
View GitHub Profile
@wlmeng11
wlmeng11 / read.c
Last active October 3, 2017 20:10
Storing and accessing uint8_t values directly in a file
#include <stdio.h>
#include <stdint.h>
#define BUFSIZE 250
int main() {
FILE *fp;
fp = fopen("mockdata.txt", "rb");
char buffer[BUFSIZE];
#!/usr/bin/env python3
import time
import pyautogui
def autodrag():
pyautogui.click()
pyautogui.dragRel(30,0)
pyautogui.dragRel(30,0)
pyautogui.dragRel(-30,0)
#!/bin/sh
for f in `ls | grep Analog_Frontend`; do
mv $f `echo $f | sed -n 's/Analog_Frontend/Phased_Array/p'`
done
@wlmeng11
wlmeng11 / receiver.ino
Created February 17, 2017 01:18
Laser UART Transmitter
/**
* Laser UART Receiver
* William Meng
* 2/16/17
*
* Based on "Gateway_better_code_receive.ino" by Sean Zimmermann
*
* What's new in this version:
* The program has been updated to work better with the laser
* transmitter and solar cell receiver circuit. The bitrate has been
#!/usr/bin/env python3
# aeblue_data_analysis.py
# William Meng
# Nov 28, 2016
from PIL import Image
def calculate_average_hsv(im):
width, height = im.size
total_pixels = width*height
@wlmeng11
wlmeng11 / filename_to_timestamp.py
Created August 7, 2016 04:08
set the EXIF timestamp of an image to match the formatted date+time string in the image's filename
#!/usr/bin/env python2
#
# filename_to_timestamp.py
#
# Purpose: set the EXIF timestamp of an image to match the formatted date+time
# string in the image's filename
#
# References: http://photo.stackexchange.com/a/2974
import sys
@wlmeng11
wlmeng11 / server_rebooter.py
Last active July 27, 2016 23:26
Use a Raspberry Pi 2 to control some relays to reboot servers
#!/usr/bin/env python2
#
# server_rebooter.py
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM) # use Broadcom numbering system
GPIO.setwarnings(False) # override any warnings about a pin being in use, comment this out to show those warnings
def relay_pin(relay_name):