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 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 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 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 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 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 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 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 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 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 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
#include <Wire.h> | |
#include <I2C_LCD.h> | |
I2C_LCD LCD; | |
extern GUI_Bitmap_t bmlogo; //Declare bitmap data package. | |
uint8_t I2C_LCD_ADDRESS = 0x51; //Device address configuration, the default value is 0x51. | |
String instring; | |
void setup(void) |