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/env python | |
import time | |
import math | |
import colorsys | |
from lsm303d import LSM303D | |
from rgbmatrix5x5 import RGBMatrix5x5 | |
def raw_heading(minimums, maximums, zero=0): | |
"""Return a raw compass heading calculated from the magnetometer data.""" |
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/env python | |
import time | |
from smbus import SMBus | |
from threading import Thread | |
import atexit | |
_bus = None | |
_t_poll = None | |
_running = 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
## This script will turn your Unicorn pHAT or Mood Light Kit into | |
## a Twitter-connected mood light that tracks the mood of your most | |
## recent tweets. | |
## You'll need to install the unicornhat, textblob, and tweepy Python | |
## libraries, and run "python -m textblob.download_corpora" to download | |
## the corpora for textblob the first time you run it. | |
## Change the start_hue and end_hue values to use a different portion of | |
## the colour wheel. Change num_tweets to track a larger number of recent |
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/env python | |
import unicornhat as unicorn | |
import time, colorsys | |
import math | |
unicorn.brightness(0.5) | |
def compute_z(x, y, t, pattern): | |
x = x + t |
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/env python | |
import unicornhat as unicorn | |
import time, colorsys | |
import skywriter | |
import signal | |
unicorn.brightness(0.4) | |
unicorn.rotation(270) |
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/env python | |
import unicornhat as unicorn | |
import time, colorsys | |
import numpy as np | |
import random | |
import skywriter | |
import signal | |
unicorn.brightness(0.4) |
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/env python | |
# Takes a bunch of screenshots from a movie and converts them into a movie barcode. | |
# You need to capture the screenshots with the command line version of VLC, which should in OS X, | |
# Windows and Linux (I think). The command (in a terminal) to do this is: | |
# vlc /path/to/movie/file --video-filter=scene --scene-prefix=movie --scene-ratio=90 --scene-path=/path/to/folder/to/store/images/ | |
# Note that it plays the movie in real time, so it takes a while. | |
# You might need to create an alias to vlc with: alias vlc='/Applications/VLC.app/Contents/MacOS/VLC' |
NewerOlder