Example #1
0
File: main.py Project: WRTIOT/weio
def setup():
    
    # check if webcam is connected
    if (os.path.exists(videoDevice)) :
        attach.process(takePicture)
    else :
        print "webcam is not connected or not recognized"
Example #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"
Example #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"
Example #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
Example #5
0
File: main.py Project: WRTIOT/weio
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
Example #6
0
def setup():
    attach.process(loop)
Example #7
0
def setup():
    attach.process(myProcess)

    # attach user-defined interrupt handler to pin 5
    attach.interrupt(pin, RISING, testInt)
Example #8
0
def setup() :
    
    # Attaches blinky function to infinite loop
    attach.process(blinky)
Example #9
0
def setup():
    digitalWrite(servoPin, LOW)
    attach.process(loop)
Example #10
0
def setup() :
    attach.process(blinky)
Example #11
0
File: main.py Project: WRTIOT/weio
def setup() :
    digitalWrite(servoPin, LOW)
    attach.process(loop)
Example #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)
Example #13
0
File: main.py Project: WRTIOT/weio
def setup():
    attach.process(arduino)
Example #14
0
def setup():
    attach.process(blinky)
Example #15
0
def setup():
    attach.process(myProcess)
Example #16
0
File: main.py Project: drasko/misc
def setup() :
    attach.process(loop)
Example #17
0
def setup():
    attach.process(arduino)
Example #18
0
def setup():
    attach.process(myProcess)
Example #19
0
File: main.py Project: WRTIOT/weio
def setup():
    attach.process(myProcess)
    
    # attach user-defined interrupt handler to pin 5
    attach.interrupt(pin, RISING, testInt)