This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Control Lasermodule from Raspberry Pi | |
# https://raspberrytips.nl/laser-module-aansturen-via-gpio/ | |
import RPi.GPIO as GPIO | |
import time | |
LaserGPIO = 17 # --> PIN11/GPIO17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Control MPU-6050 Gyroscoop + Accelerometer from Raspberry Pi | |
# https://raspberrytips.nl/mpu-6050-gyroscoop-raspberry-pi/ | |
import smbus | |
import math | |
# Power management registers | |
power_mgmt_1 = 0x6b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# DS18B20 waterdichte temperatuur sensor aansluiten op Raspberry Pi | |
# https://raspberrytips.nl/ds18b20-raspberry-pi/ | |
import os | |
import glob | |
import time | |
os.system('modprobe w1-gpio') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://raspberrytips.nl | |
# Just change: | |
# import RPi.GPIO as GPIO | |
# Into: | |
from RTk import GPIO | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://raspberrytips.nl/ws2801-ledstrip/ | |
# Simple demo script for a WS2801/SPI-like addressable RGB LED lightstrip. | |
import time | |
import RPi.GPIO as GPIO | |
import Adafruit_WS2801 | |
import Adafruit_GPIO.SPI as SPI | |
# Configure the count of pixels: | |
PIXEL_COUNT = 32 |
OlderNewer