Another great use for BlinkyTape comes to us from our forum user Eric C. aka “revsin.” Like our last post this is an ambient information visualizer – but for a very different purpose. Eric is a motorcyclist and wants to know at a glance if it’s going to be dry for the next few hours – i.e. whether or not it’s a safe time for a ride.
In order to do this, he’s writing a python script that quickly scrapes a weather website for the next few hours of weather and then writes it out to his BlinkyTape – each LED corresponds to a few minutes.
Very awesome – click through to for the python!
Here’s the script:
bb = BlinkyTape(‘/dev/tty.usbmodem1441’)
url = ‘http://www.accuweather.com/en/us/madison-al/35757/minute-weather-forecast/15532_pc’
website = urllib2.urlopen(url)
html = website.read()
regex = ‘<span class="time">(.+?)</span>.*<span class="type">(.+?)</span>’
pattern = re.compile(regex)
clockandprecip = re.findall(pattern,html)
wlist = 
for i in clockandprecip: # [::5] limits to every 5 minutes
condition = i
time = i
if condition == ‘No Precipitation’:
rgb = 255,0,0
rgb = 0,255,0 # green
for d in range(60):
for x in wlist[::2]: # limits to every other minute
As an aside, these last two projects show that python is a great way to program for ambient installations – not only it python a great language, it runs on both PC hardware or embedded machines (i.e. Raspberry Pi or Beaglebone) with minimal changes!