Пример #1
0
def setup():
    
    # check if webcam is connected
    if (os.path.exists(videoDevice)) :
        attach.process(takePicture)
    else :
        print "webcam is not connected or not recognized"
Пример #2
0
def setup():

    # check if webcam is connected
    if (os.path.exists(videoDevice)):
        attach.process(takePicture)
    else:
        print "webcam is not connected or not recognized"
Пример #3
0
def setup():
    
    # check if webcam is connected
    if (os.path.exists(videoDevice)) :
        attach.process(startVideoStreaming)
    else :
        print "webcam is not connected or not recognized"
Пример #4
0
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
Пример #5
0
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
Пример #6
0
def setup():
    attach.process(loop)
Пример #7
0
def setup():
    attach.process(myProcess)

    # attach user-defined interrupt handler to pin 5
    attach.interrupt(pin, RISING, testInt)
Пример #8
0
def setup() :
    
    # Attaches blinky function to infinite loop
    attach.process(blinky)
Пример #9
0
def setup():
    digitalWrite(servoPin, LOW)
    attach.process(loop)
Пример #10
0
def setup() :
    attach.process(blinky)
Пример #11
0
def setup() :
    digitalWrite(servoPin, LOW)
    attach.process(loop)
Пример #12
0
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)
Пример #13
0
def setup():
    attach.process(arduino)
Пример #14
0
def setup():
    attach.process(blinky)
Пример #15
0
def setup():
    attach.process(myProcess)
Пример #16
0
def setup() :
    attach.process(loop)
Пример #17
0
def setup():
    attach.process(arduino)
Пример #18
0
def setup():
    attach.process(myProcess)
Пример #19
0
def setup():
    attach.process(myProcess)
    
    # attach user-defined interrupt handler to pin 5
    attach.interrupt(pin, RISING, testInt)