Skip to content

Instantly share code, notes, and snippets.

View TheRealEdDawson's full-sized avatar

Ed Dawson TheRealEdDawson

  • Learnosity
  • Sydney
View GitHub Profile
@TheRealEdDawson
TheRealEdDawson / script.txt
Last active May 21, 2018 04:07
T-Rex Hot Chocolate: A Game in PuzzleScript
title T-Rex Hot Chocolate
author Ed & Tommy Dawson
homepage www.puzzlescript.net
========
OBJECTS
========
Background
White
@TheRealEdDawson
TheRealEdDawson / BootPython.sh
Last active June 20, 2020 19:28
A simple shell script to run a Python program at boot time on Raspberry Pi.
#! /bin/sh
# /etc/init.d/BootPython
### BEGIN INIT INFO
# Provides: Runs a Python script on startup
# Required-Start: BootPython start
# Required-Stop: BootPython stop
# Default-Start: 2 3 4 5
# Default-stop: 0 1 6
# Short-Description: Simple script to run python program at boot
@TheRealEdDawson
TheRealEdDawson / PIRsensor.py
Last active December 16, 2015 00:59
Program to take the inputs of both passive infrared (PIR) and photocell sensors and combine that data to "detect things moving in the dark", & turn on a light.
import RPi.GPIO as GPIO, time, os
DEBUG = 1
GPIO.setmode(GPIO.BCM)
# Setting up port to use on Blue LED
BLUE_LED = 25
GPIO.setup(BLUE_LED, GPIO.OUT)
# Define GPIO port to use for PIR
@TheRealEdDawson
TheRealEdDawson / photocell.py
Created April 10, 2013 03:59
A program to measure the output from a photocell sensor.
import RPi.GPIO as GPIO, time, os
DEBUG = 1
GPIO.setmode(GPIO.BCM)
BLUE_LED = 23
GPIO.setup(BLUE_LED, GPIO.OUT)
def RCtime (RCpin):
reading = 0
GPIO.setup(RCpin, GPIO.OUT)
@TheRealEdDawson
TheRealEdDawson / mp3buttons.py
Last active August 6, 2019 03:05
Rapsberry Pi MP3 Buttons
from time import sleep
import os
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(23, GPIO.IN)
GPIO.setup(24, GPIO.IN)
GPIO.setup(25, GPIO.IN)
while True:
@TheRealEdDawson
TheRealEdDawson / ledrandomizer.py
Last active November 7, 2022 15:47
LED Randomizer for Raspberry Pi.
import RPi.GPIO as GPIO, time
import random
# Setting up random seed variables
random.seed()
ledresult = 1
# Setting up some structures for the Raspberry Pi LED controls
GPIO.setmode(GPIO.BCM)
GREEN_LED = 18
import RPi.GPIO as GPIO, time
import urllib2
# Setting up variables for site checking
sitewearechecking = "http://www.idg.com.au"
textweshouldfind = "<title>IDG Communications - Australia</title>"
frequencyofchecking = 5 #Every 5 Seconds
siteup = False #True = site is up
# Setting up some structures for the Raspberry Pi LED controls