from iColorFlex import IColorFlex from KinetSender import KinetSender import sys, random, time import math if __name__ == '__main__': SELF_IP = "131.179.141.34" PDS_IP = "131.179.141.127" # Broadcast on our subnet strandPair = IColorFlex(ports=2, portstart=1) kinetsender = KinetSender(SELF_IP, PDS_IP, 2, 150, None, False) kinetsender.addPayloadObject(strandPair) # start the thing (hops to black if we haven't set the payload) kinetsender.start() h = [] s = [] l = [] # HUE RANGE # H = 220 to 340 # AND FOR NOW, # S = 1 # L = 0.5
print "year wait is ", config.yearWait, "xfTime is", config.xfTime sleep(config.yearWait) updateCountries(config.categories.index(cat), config.years.index(year), buildCountries(year, cat)) if __name__ == "__main__": # Network configuration : for production system # IP Address. . . . . . . . . . . . : 131.179.141.34 # Subnet Mask . . . . . . . . . . . : 255.255.255.128 # Default Gateway . . . . . . . . . : 131.179.141.1 # Set up a single icolorflex sender # and broadcast it to all strands # if config.light: strandPair = IColorFlex(2) kinetsender = KinetSender(config.SELF_IP, config.PDS_IP, 2, 150, None, False) kinetsender.addPayloadObject(strandPair) strandPair.setHSL(0, 0, 0) # Set initial payload to black kinetsender.start() print ("generating values for lighting from GDP") application.listen(8082) # tornado.ioloop.PeriodicCallback(res, 1) respondToKey(54) # cannot seem to start these both simultaneously... they're mutually exclusive. # can't find a simple thread manager pattern that lets me at least exchange a key stroke... thread.start_new_thread(mainLoop, ("loop thread", g))