Skip to content

Instantly share code, notes, and snippets.

View hbldh's full-sized avatar

Henrik Blidh hbldh

View GitHub Profile
@hbldh
hbldh / serial_com_arduino.ino
Last active February 16, 2016 13:58
Sweet Chariot Code
int incomingByte; // a variable to read incoming serial data into
int pwm_a = 5; //PWM control for motor outputs 1 and 2
int pwm_b = 9; //PWM control for motor outputs 3 and 4
int dir_a = 4; //direction control for motor outputs 1 and 2
int dir_b = 8; //direction control for motor outputs 3 and 4
void setup() {
// Initialize serial communication on UART TX/RX
Serial.begin(9600);
@hbldh
hbldh / move_photos.py
Last active December 4, 2015 13:50
A simple program for rearranging files, e.g. photos in a photo collection.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
move_photos.py
==================
Created by: hbldh <henrik.blidh@nedomkull.com>
Created on: 2015-12-03, 22:34
"""
@hbldh
hbldh / subprocess_thread.py
Created February 4, 2015 09:32
Subprocess with timout. Inspired by http://stackoverflow.com/a/4825933
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`subprocess_thread`
========================
.. module:: subprocess_thread
:platform: Unix, Windows
:synopsis: