def setup(): # check if webcam is connected if (os.path.exists(videoDevice)) : attach.process(takePicture) else : print "webcam is not connected or not recognized"
def setup(): # check if webcam is connected if (os.path.exists(videoDevice)): attach.process(takePicture) else: print "webcam is not connected or not recognized"
def setup(): # check if webcam is connected if (os.path.exists(videoDevice)) : attach.process(startVideoStreaming) else : print "webcam is not connected or not recognized"
def setup(): # Attaches sensor function to infinite loop attach.process(blinky) # Attaches sensor function to infinite loop attach.process(potentiometer) # Instanciate shared objects shared.val = 0
def setup(): attach.process(loop)
def setup(): attach.process(myProcess) # attach user-defined interrupt handler to pin 5 attach.interrupt(pin, RISING, testInt)
def setup() : # Attaches blinky function to infinite loop attach.process(blinky)
def setup(): digitalWrite(servoPin, LOW) attach.process(loop)
def setup() : attach.process(blinky)
def setup() : digitalWrite(servoPin, LOW) attach.process(loop)
def potar(): val = 0 val_p = 0 while True: val = analogRead(25) if (abs(val - val_p) > 10): hue = proportion(val, 0, 1023, 0.0, 1.0) # drive HUE color and transform to rgb for LED rgb = colorsys.hsv_to_rgb(hue, 1.0, 1.0) # rgb output is 0.0-1.0 transform to 0-255 red = int(rgb[0] * 255.0) green = int(rgb[1] * 255.0) blue = int(rgb[2] * 255.0) setColor(red, green, blue) val_p = val time.sleep(0.05) def proportion(value, istart, istop, ostart, ostop): return float(ostart) + (float(ostop) - float(ostart)) * ( (float(value) - float(istart)) / (float(istop) - float(istart))) # Attaches interrupt from Web client to "message" string attach.event('message', buttonHandler) attach.process(potar)
def setup(): attach.process(arduino)
def setup(): attach.process(blinky)
def setup(): attach.process(myProcess)
def setup() : attach.process(loop)