Skip to content

Instantly share code, notes, and snippets.

@simonjenny
simonjenny / phone
Created January 19, 2018 09:14
Fairytale Phone - Next Thing Co C.H.I.P Version
#!/usr/bin/python
import CHIP_IO.GPIO as GPIO
import math, sys, os
import subprocess
import socket
GPIO.setup("XIO-P7", GPIO.IN);
GPIO.setup("XIO-P6", GPIO.IN);
@simonjenny
simonjenny / create-a-pi
Last active January 9, 2020 12:07
Create-A-Pi
#!/bin/bash
command -v pv >/dev/null 2>&1 || { echo "Dieses Script benötigt das Programm pv." >&2; exit 1; }
# Shell Script for creating a pi sd card iwth the latest Rasbian
# Author <simon.jenny@me.com> Simon Jenny
#
# -------------------------------------------
if [ "$1" == "" ]; then
echo "Drive Folder Parameter missing!"
echo "Usage : create-a-pi DRIVE (eg /dev/disk2)"
echo "Here are all your mounted drives:"
@simonjenny
simonjenny / phone.py
Last active December 20, 2021 10:51
Fairytale Phone
#!/usr/bin/python3
import RPi.GPIO as GPIO
import math, sys, os
import subprocess
import socket
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP)