Skip to content

Instantly share code, notes, and snippets.

Avatar

raspberrytips.nl raspberrytipsnl

View GitHub Profile
@raspberrytipsnl
raspberrytipsnl / joystick.py
Created Feb 4, 2019
Analog Joystick / MCP3008 / Raspberry Pi
View joystick.py
#!/usr/bin/python
import spidev
import time
import os
spi = spidev.SpiDev()
spi.open(0,0)
spi.max_speed_hz=1000000
@raspberrytipsnl
raspberrytipsnl / bmp180.py
Created Feb 3, 2019
BMP180 luchtdruk + temperatuur sensor (Raspberry Pi)
View bmp180.py
#!/usr/bin/python
# BMP180 luchtdruk + temperatuur sensor
# https://www.raspberrytips.nl
import smbus
import time
from ctypes import c_short
DEVICE = 0x77
@raspberrytipsnl
raspberrytipsnl / goodwe-lcd.py
Created Aug 25, 2018
Goodwe data LCD display
View goodwe-lcd.py
#!/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 / Goodwe.py
Created Aug 25, 2018
Gegevens Goodwe omvormer inlezen met Python
View Goodwe.py
#!/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 / lcdi2c.py
Created Apr 5, 2018
LCD scherm (16×2) via I2C backpack aansturen
View lcdi2c.py
#!/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 / motion-homekit.ino
Created Mar 27, 2018
Homekit (Homebridge) bewegingsmelder(motion sensor) script Arduino/Wemos
View motion-homekit.ino
// 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 / cpu-temp.py
Created Mar 17, 2018
Displat CPU temp on Pimoroni Four letter PHAT
View cpu-temp.py
#!/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 / lirc_kpn_mediabox.conf
Created Mar 9, 2018
LIRC config KPN Mediabox (Arcadyan HMB2260, Motorola VIP 19xx, Arris VIP 29xx)
View lirc_kpn_mediabox.conf
#
# 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 / tripwire.py
Created Jun 20, 2017
Tripwire met laser module en lichtsensor
View tripwire.py
#!/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 / tcrt5000sensor.py
Last active Jun 13, 2017
TCRT5000 tracking sensor
View tcrt5000sensor.py
#!/usr/bin/env python
# TCRT5000 tracking sensor
# https://raspberrytips.nl/tcrt5000
import RPi.GPIO as GPIO
TrackingPin = 11
def setup():
You can’t perform that action at this time.