Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

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

By: a guest on Nov 9th, 2011  |  syntax: Python  |  size: 0.32 KB  |  views: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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.