Skip to content

Instantly share code, notes, and snippets.

@RZRZR
RZRZR / color.py
Last active November 14, 2019 15:09 — forked from bennuttall/color.py
import time
from gpiozero import SPIDevice
from colorzero import Color, Hue
class Apa102Pixel(SPIDevice):
def __init__(self, *args, **kwargs):
super(Apa102Pixel, self).__init__(*args, **kwargs)
self._brightness = 255.0
self._value = (0, 0, 0)
@RZRZR
RZRZR / van_monitor.ino
Created January 27, 2017 20:59
van_monitor.ino
#include <TinyGPS++.h> // Tiny GPS Plus Library
#include <SoftwareSerial.h> // for GPS
//#include <SPI.h>
#include <ESP8266WiFi.h>
#include <ThingerWifi.h>
//#include <Adafruit_Sensor.h>
//#include <math.h>
#include "DHT.h"
//#include <Adafruit_NeoPixel.h>
//#include <SD.h>
#include <SPI.h>
const int relayPin = D3;
const int btnPlus = D8;
const int btnMinus = D7;
const int btnBack = D6;
const int btnEnter = D5;
float time = 5.00;
@RZRZR
RZRZR / db.py
Last active January 23, 2016 19:59
import os
import sqlite3 as sqlite
from datetime import datetime
import mopiapi
from time import sleep, time
from datetime import datetime
from gpiozero import OutputDevice
import water
import temp
mp = mopiapi.mopiapi()
@RZRZR
RZRZR / plants.md
Last active January 9, 2016 22:55

Set Up

Solar Panel (20W)
  controller
    12V battery (7.2ah)
      MoPi
        Raspberry Pi A+
          Camera Module 
          Wifi Adapter

#Explorer HAT Pro, Motors, Servos and Steppers

Find this Gist at: tiny.cc/explorerhat

The Motor driver on Explorer HAT Pro can not only drive motors, but a stepper motor too. And just like the Pibrella the outputs can also drive a motor or four, or another stepper.

Explorer HATs outputs sink to ground, meaning that you need to connect whatever you're driving between 5V and the output

#MOTORS

from RPi import GPIO
from time import sleep
ROOF_LEFT = [9, 13, 19]
INSIDE_LEFT = [16, 20, 26, 21]
INSIDE_RIGHT = [25, 5, 7, 8, 12, 6, 11]
LEDS = ROOF_LEFT + INSIDE_LEFT + INSIDE_RIGHT
PULL = GPIO.PUD_UP
from energenie import switch_on, switch_off
from time import sleep
from datetime import datetime, time
import RPi.GPIO as GPIO
import thread
now = datetime.now()
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
@RZRZR
RZRZR / lcd.py
Created November 27, 2014 13:59
LCD
#!/usr/bin/python
#
# HD44780 LCD Test Script for
# Raspberry Pi
#
# Author : Matt Hawkins
# Site : http://www.raspberrypi-spy.co.uk
#
# Date : 26/07/2012
#
@RZRZR
RZRZR / table.md
Last active August 29, 2015 14:08
Why does my table not work ?

6 day Timetable

Research (Part C) to be done as homework and presented to the group as part of the introductions.

Monday Tuesday Wednesday Thursday Friday Saturday
Morning Intro to Raspberry Pi. Staff Personal Intros (10mins x 3) Coach to London - Meet at RasPi HQ Make (A) Make (A) Plan Workshops (D) Deliver Workshops (D)
10:30 - 13:00: DC's presentations: Personal intros & Research (C) - 10 mins x 14. Go See (B) Make (A) Make (A) Workshop Prep (D) Deliver Workshops (D)
Afternoon Continue DC presentations. Intro to Digital Creatives Programme Go See (B) Make (A) Make (A) Talk about Gold Award Presentations (B & D)