Beispiel #1
0
def combine():





    #print('-'*header)
    #print('  r: roll')
    #print('  p: pitch')
    #print('  h: heading')
    #print('  g: gravity')
    #print('deg: degree')
    #print('')

if __name__ == "__main__":
    try:
        while True:
            flower = ahrs()
            data = bmp280_readdata(0x77)
            p = bmp280_convert(data)
            t = bmp280_checktemp(data)
            temp, hum = temp_and_hum()
            print("fall",flower,"pressure",p,"temperature",t,"humidity",hum)
            publish_data(temp, hum, p, flower)
    except Exception as e:
        print(e)
    except KeyboardInterrupt:
        pass
Beispiel #2
0
def combine():
    while ture:
        flower = arch()
        data = bmp280_readdata(0x77)
        p = bmp280_convert(data)
        t = bmp280_checktemp(data)
        publish_data(temp, hum, p, flower)
Beispiel #3
0
def combine():
    temp = None
    hum = None
    while True:
        flower = ahrs()
        data = bmp280_readdata(0x77)
        p = bmp280_convert(data)
        t = bmp280_checktemp(data)
        temp = temp()
        hum = hum()
        publish_data(temp, hum, p, flower)
Beispiel #4
0
    manual_return = False
    manual_backward = False
    manual_rotate = False
    manual_message = None

    counter = 0  #record number of backward movement
    stabilizer = True  # use to delay movement of motor to avoid problems cause by humidity
    time_delay_humidity = 2  # 2 minutes wait for humidity

    current_rotate_position = 0

    try:
        while True:
            client.loop_start()
            flower = ahrs()
            data = bmp280_readdata()
            p = bmp280_convert(data)
            t = bmp280_checktemp(data)
            te = temp()
            hu = hum()
            print("fall:", flower, "pressure:", p, "temperature:", t,
                  "humidity:", hu)
            received = receive_data
            check1 = True
            check2 = True

            try:
                manual_message = received["Action"]

                print("manual message", manual_message)
Beispiel #5
0
    p = abs(p)
    #h =abs(h)

    if r>50 or p>50 :
        fall = True
    else:
        fall =False

    return fall


if __name__ == "__main__":
    try:

       while True:
             flower = ahrs()
             data = bmp280_readdata(0x77)
             p = bmp280_convert(data)
             t = bmp280_checktemp(data)
             te = temp()
             hu = hum()
             print("fall:", flower, "pressure:", p, "temperature:", t, "humidity:", hu)
             publish_data(te, hu, p, flower)

    except Exception as e:
        print(e)
    except KeyboardInterrupt:
        pass

    #print('Done ...'