Skip to content

Instantly share code, notes, and snippets.

#include "Keyboard.h"
const int buttonPin = 11; // input pin for pushbutton
int previousButtonState = HIGH; // for checking the state of a pushButton
int counter = 0; // button push counter
int prevTime = 0;
void setup() {
// make the pushButton pin an input:
pinMode(buttonPin, INPUT);
@speendo
speendo / mpd_broken_pipe.py
Created December 24, 2015 15:41
Broken pipe problem with mpd
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from mpd import MPDClient
from mpd import ConnectionError as MPDConnectionError
from time import sleep
import logging
# Timeout
@speendo
speendo / mpd_timeout_test.py
Created December 15, 2015 19:18
BrokenPipeError when idle for a couple of hours
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from mpd import MPDClient
from mpd import ConnectionError as MPDConnectionError
from time import sleep
import logging
# Timeout
// PieTest
/**
* @param float radius Radius of the pie
* @param float angle Angle (size) of the pie to slice
* @param float height Height (thickness) of the pie
* @param float spin Angle to spin the slice on the Z axis
*/
module pie(radius, angle, height, spin=0) {
// submodules
@speendo
speendo / i2c LCD Hello world
Created September 21, 2015 23:24
Attempt on "Hello world!" with a 2004 LCD, I2C, PCF8574 and wiringPi
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <wiringPi.h>
#include <pcf8574.h>
#include <lcd.h>