This file contains hidden or 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 pigpio | |
| # servo/gpio control | |
| pi = pigpio.pi() | |
| # choose your pins | |
| tilt = 17 | |
| pan = 27 | |
| # center the servos |
This file contains hidden or 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 evdev import InputDevice | |
| # create object to read input - specify YOUR device | |
| controller = InputDevice('/dev/input/event0') | |
| # want to display ALL info? | |
| debug = False | |
| # what are the controller details? | |
| print(controller) |
This file contains hidden or 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 os | |
| import picamera | |
| import gpiozero | |
| from gpiozero import Button | |
| import time | |
| import datetime | |
| from time import sleep | |
| camera = picamera.PiCamera() | |
| button = Button(23) |
This file contains hidden or 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 RPi.GPIO as GPIO | |
| import time | |
| # Pi has (confusingly) two numbering schemes for pins | |
| # usually you would choose based on what is printed on | |
| # your dongles/pinout prints | |
| GPIO.setmode(GPIO.BCM) | |
| # H-Bridge pins |
This file contains hidden or 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 random | |
| import arcade | |
| import _thread | |
| class Fireball(arcade.Sprite): | |
| def update(self): | |
| move_rate = 10 | |
| self.center_y += move_rate |
This file contains hidden or 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://makerhacks.com | |
| import subprocess | |
| import arcade | |
| # Open the window. Set the window title and dimensions (width and height) | |
| arcade.open_window(800, 600, "Drawing Test") | |
| arcade.set_background_color(arcade.color.BLACK) | |
This file contains hidden or 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 | |
| import cgi | |
| import cgitb | |
| cgitb.enable() | |
| print("Content-Type: text/html\n\n") | |
| print(""" | |
| <html><head><title>CatCam</title> | |
| <meta charset="utf-8"> |
This file contains hidden or 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
| #!/bin/bash | |
| while [ 1 ]; | |
| do | |
| raspistill -o cam.jpg | |
| scp cam.jpg [email protected]:apache/html/cam | |
| sleep 5s | |
| done | |
This file contains hidden or 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 PIL | |
| from PIL import Image | |
| import pyzbar.pyzbar as pyzbar | |
| import pygame | |
| import pygame.camera | |
| from pygame.locals import * | |
| # set up the camera | |
| pygame.init() | |
| pygame.camera.init() |
This file contains hidden or 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 PIL | |
| from PIL import Image | |
| import pyzbar.pyzbar as pyzbar | |
| import pygame | |
| import pygame.camera | |
| from pygame.locals import * | |
| # set up the camera | |
| pygame.init() | |
| pygame.camera.init() |