Example #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
Example #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)
Example #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)
Example #4
0
    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)

                if manual_message == "manual_turn":