Beispiel #1
0
def heightGetValue():
    """ Get plant, lamp height, update database, adjust height. """
    lightStartup.wait()
    plantHeight = pyCamera.getCameraData()
    lampHeight = serialRequest('LH')
    writeDatabase(plantHeight, lampHeight, writeTable='height')
    heightDiff = readDatabase(readTable='user_height')
    desiredLampHeight = plantHeight + heightDiff[0]
    difference = abs(float(lampHeight) - desiredLampHeight)
    shiftDistance = "%d" % (difference)
    if lampHeight > desiredLampHeight:
        response = serialRequest('L+' + shiftDistance)
    elif lampHeight < desiredLampHeight:
        response = serialRequest('L-' + shiftDistance)
    lightStartup.clear()
    heightGetValue()
Beispiel #2
0
def heightGetValue():
    """ Get plant, lamp height, update database, adjust height. """
    lightStartup.wait()
    plantHeight = pyCamera.getCameraData()
    lampHeight = serialRequest('LH')
    writeDatabase(plantHeight,
                  lampHeight, 
                  writeTable = 'height')
    heightDiff = readDatabase(readTable = 'user_height')
    desiredLampHeight = plantHeight + heightDiff[0]
    difference = abs(float(lampHeight) - desiredLampHeight)
    shiftDistance = "%d" % (difference) 
    if lampHeight > desiredLampHeight:
        response = serialRequest('L-' + shiftDistance)
    elif lampHeight < desiredLampHeight:
        response = serialRequest('L+' + shiftDistance)
    lightStartup.clear()
    heightGetValue()
Beispiel #3
0
import pyCamera as cam

plant_height_mm = cam.getCameraData()
print plant_height_mm