Skip to content

Instantly share code, notes, and snippets.

View raspberrytipsnl's full-sized avatar

raspberrytips.nl raspberrytipsnl

View GitHub Profile
@raspberrytipsnl
raspberrytipsnl / lcd20x4.py
Created April 11, 2017 09:50
LCD scherm 20×4 met behulp van I2C aansturen
#!/usr/bin/python
# https://raspberrytips.nl/lcd-scherm-20x4-i2c-raspberry-pi/
import sys
import smbus
import time
import datetime
import subprocess
I2C_ADDR = 0x3F # I2C device address
@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 / lirc_kpn_mediabox.conf
Created March 9, 2018 10:12
LIRC config KPN Mediabox (Arcadyan HMB2260, Motorola VIP 19xx, Arris VIP 29xx)
#
# Manufacturer: Motorola, Arcadyan, Arris
# Model: KPN Mediabox
#
# Keywords: lirc configuration, IR codes
# Remark: Should work the following devices: (often used by KPN and TELFORT)
#
# Arcadyan HMB2260
# Motorola VIP 1853
# Motorola VIP 1963
@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
@raspberrytipsnl
raspberrytipsnl / lcdi2c.py
Created April 5, 2018 14:04
LCD scherm (16×2) via I2C backpack aansturen
#!/usr/bin/python
import smbus
import time
import datetime
I2C_ADDR = 0x27 # I2C device address
LCD_WIDTH = 16 # Maximum characters per line
# Define some device constants
@raspberrytipsnl
raspberrytipsnl / Goodwe.py
Created August 25, 2018 14:38
Gegevens Goodwe omvormer inlezen met Python
#!/usr/bin/python
import json
import urllib
try:
jsonfile = json.load(urllib.urlopen('https://eu.goodwe-power.com/Mobile/GetMyPowerStationByUser?userName=GEBRUIKERSNAAM'))
except ValueError:
print 'Error data kan niet geladen worden...'
@raspberrytipsnl
raspberrytipsnl / goodwe-lcd.py
Created August 25, 2018 14:50
Goodwe data LCD display
#!/usr/bin/python
# https://raspberrytips.nl/raspberry-pi-goodwe-zonnepaneel-omvormer/
# 25/08/2018 - Richard IJzermans
import sys
import smbus
import time
import datetime
import json
@raspberrytipsnl
raspberrytipsnl / bmp180.py
Created February 3, 2019 12:03
BMP180 luchtdruk + temperatuur sensor (Raspberry Pi)
#!/usr/bin/python
# BMP180 luchtdruk + temperatuur sensor
# https://www.raspberrytips.nl
import smbus
import time
from ctypes import c_short
DEVICE = 0x77