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
# The basics of writing Python games | |
# See Game Development in Python 3 With PyGame on YouTube | |
import pygame | |
import time | |
import random | |
pygame.init() | |
pygame.key.set_repeat(50, 50) #So that when you hold a key down, it repeats | |
display_width = 800 | |
display_height = 445 | |
pause = False |
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
// Written by Adafruit. https://learn.adafruit.com/multi-tasking-the-arduino-part-1/a-classy-solution | |
// Modified by S&S | |
// A method of achieving control of individual LEDs connected to the Arduino outputs | |
// | |
class Flasher | |
{ | |
// Class Member Variables | |
// These are initialized at startup | |
int ledPin; // the number of the LED pin | |
long OnTime; // milliseconds of on-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
# S&S's version for a common ANODE 7-segment display driven by Raspberry Pi | |
# code modified, tweaked and tailored from code by bertwert | |
# on RPi forum thread topic 91796 | |
import RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BCM) | |
# GPIO ports for the 7seg pins | |
segments = (11,4,23,8,7,10,18,25) | |
# 7seg_segment_pins (14,16,13,3,5,11,15,7) + 670R inline |
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
# 4-digit 7-segment COMMON CATHODE display driven by Raspberry Pi B+ | |
# code modified, tweaked and tailored from code by bertwert | |
# on RPi forum thread topic 91796 | |
# and fiddled with a bit more by S&S | |
import RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BCM) | |
# GPIO ports for the 7seg pins | |
segments = (11,4,23,8,7,10,18,25) |
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/python3 | |
from sense_hat import SenseHat | |
sense = SenseHat() | |
sense.clear() | |
old_x = old_y = 0 | |
while True: | |
o = sense.get_orientation() | |
pitch = o["pitch"] |
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/python3 | |
from sense_hat import SenseHat | |
import math | |
import pi3d | |
sense = SenseHat() | |
display = pi3d.Display.create() | |
cam = pi3d.Camera.instance() |
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
//RasPiO Duino RGB color fading Mood Light NOW WITH LIGHT SENSING CAPABILITIES!!! | |
const int redPin = 11; | |
const int grnPin = 10; | |
const int bluPin = 9; | |
const int sensor = 3; | |
void setup() | |
{ |
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 picamera | |
from picamera import PiCamera | |
from picamera.array import PiRGBArray | |
from sense_hat import SenseHat | |
sense = SenseHat() | |
camera = picamera.PiCamera() | |
def preview(): |
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
from Tkinter import * | |
import time | |
import picamera | |
import RPi.GPIO as GPIO | |
import numpy as np | |
import io | |
from datetime import datetime, timedelta | |
GPIO.setwarnings(False) | |
GPIO.setmode(GPIO.BCM) |
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
# GPIO GUI by S&S 5-Apr-15 | |
from Tkinter import * | |
import RPi.GPIO as GPIO | |
import time | |
GPIO.setwarnings(False) | |
GPIO.setmode(GPIO.BCM) |
NewerOlder