Advertisement
Guest User

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

a guest
Nov 9th, 2011
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  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.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement