SHARE
TWEET

Text message to LED color with the Rascal, rascalmicro.com

a guest Nov 9th, 2011 18 Never
  1. @public.route('/sms', methods=['POST'])
  2. def parse_sms():
  3.     import subprocess, webcolors
  4.     color = webcolors.name_to_rgb(request.form['Body'])
  5.     cmd = 'blinkm set-rgb -d 9 -r ' + str(color[0]) + ' -g ' + str(color[1]) + ' -b ' + str(color[2])
  6.     subprocess.Popen([cmd], shell=True)
  7.     return ('color sent to Blinkm')
  8.  
  9.  
RAW Paste Data
Top