Skip to content

Instantly share code, notes, and snippets.

View raspberrytipsnl's full-sized avatar

raspberrytips.nl raspberrytipsnl

View GitHub Profile
@raspberrytipsnl
raspberrytipsnl / afstand.py
Last active February 2, 2017 13:55
HC-SR04 ultrasone sensor
#!/usr/bin/env python
# Control HC-SR04 ultrasone sensor from Raspberry Pi
# https://raspberrytips.nl/hc-sr04-ultrasone-sensor/
import RPi.GPIO as GPIO #Import GPIO library
import time #Import time library
GPIO.setmode(GPIO.BCM) #Set GPIO pin numbering
TRIG = 23 #Associate pin 23 to TRIG
@raspberrytipsnl
raspberrytipsnl / radio.py
Created February 3, 2017 12:45
Internet radio Raspberry Pi + PiFace CAD
#!/usr/bin/env python3
# requires `mplayer` to be installed
# v1.0
# https://raspberrytips.nl/internet-radio-luisteren-raspberry-pi/
from time import sleep
import os
import sys
import signal
@raspberrytipsnl
raspberrytipsnl / rtkgpio_led.py
Created February 6, 2017 14:38
RTk.GPIO led example script
# https://raspberrytips.nl
# Just change:
# import RPi.GPIO as GPIO
# Into:
from RTk import GPIO
import time
@raspberrytipsnl
raspberrytipsnl / neopixelring.py
Last active February 22, 2017 10:14
Demoscript NeoPixel Ring (12 led)
# Demoscript NeoPixel Ring (12 led)
# https://raspberrytips.nl
import time
from neopixel import *
from random import randint
LEDS = 12 # Aantel LEDS
PIN = 18 # GPIO 18 / PIN 12
import Adafruit_GPIO.SPI as SPI
import Adafruit_SSD1306
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
disp = Adafruit_SSD1306.SSD1306_128_32(rst=24)
disp.begin()
import time
import sys
import subprocess
import Adafruit_GPIO.SPI as SPI
import Adafruit_SSD1306
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
@raspberrytipsnl
raspberrytipsnl / tcrt5000sensor.py
Last active June 13, 2017 11:51
TCRT5000 tracking sensor
#!/usr/bin/env python
# TCRT5000 tracking sensor
# https://raspberrytips.nl/tcrt5000
import RPi.GPIO as GPIO
TrackingPin = 11
def setup():
@raspberrytipsnl
raspberrytipsnl / tripwire.py
Created June 20, 2017 12:45
Tripwire met laser module en lichtsensor
#!/usr/bin/env python
# Tripwire met laser module en lichtsensor
# https://raspberrytips.nl/tripwire-laser
from datetime import datetime
import RPi.GPIO as GPIO
import os, time
SensorGPIO = 23
@raspberrytipsnl
raspberrytipsnl / cpu-temp.py
Created March 17, 2018 13:59
Displat CPU temp on Pimoroni Four letter PHAT
#!/usr/bin/env python
import time
import fourletterphat
from subprocess import Popen, PIPE
print("""
Four Letter pHAT: cpu-temp.py
This example will display your Pi's CPU
@raspberrytipsnl
raspberrytipsnl / motion-homekit.ino
Created March 27, 2018 08:57
Homekit (Homebridge) bewegingsmelder(motion sensor) script Arduino/Wemos
// Homekit motions sensor voor HomeBridge
// raspberrytips.nl
#include <ESP8266WiFi.h>
const char* ssid = "naamnetwerk"; // SSID Wifi (naam)
const char* password = "watchwoord"; // Wachtwoord wifi
IPAddress ip(192, 168, 2, 99); // IP address
IPAddress dns(192, 168, 2, 254); // IP address DNS server