Example #1
0
def gyro_start(obj):
    global _pos
    import i2c_bus
    _pos = [0, 0]
    lcd.image(0, 0, '/flash/img/3-3.jpg', type=lcd.JPG)
    obj['color']= lcd.RED
    from lib import imu
    obj['imu'] = imu.IMU()
    if obj['imu'].address == 0x68:
        if obj['imu'].whoami == 0x19:
            if get_bmm150_status():
                obj['color'] = lcd.BLACK
                lcd.font(lcd.FONT_Default)
                lcd.print("bmm150", 190, 20, 0xFFAAAA)# 2# m5stack stuck in this
        else:
            lcd.font(lcd.FONT_Default)
            lcd.print("IMU:MPU9250", 190, 20, 0xFFAAAA)
            obj['color'] = lcd.BLACK
    elif obj['imu'].address == 0x6c:
        if get_bmm150_status():
            obj['color'] = lcd.BLUE
            lcd.font(lcd.FONT_Default)
            lcd.print("IMU:SHQ200", 190, 20, 0xFFAAAA)
    obj['buf'] = [[0, 0] for i in range(0, 6)]
    lcd.rect(65, 65, 60, 60, lcd.WHITE, lcd.WHITE)  # old pic dot clean
Example #2
0
def gyro_start(obj):
    global _pos
    import i2c_bus

    _pos = [0, 0]
    lcd.image(0, 0, '/flash/img/3-3.jpg', type=lcd.JPG)
    obj['color']= lcd.RED
    from lib import imu
    obj['imu'] = imu.IMU()
    if obj['imu'].address == 0x68:
        if obj['imu'].whoami == 0x19:
            if get_bmm150_status():
                obj['color'] = lcd.GREEN
        else:
            obj['color'] = lcd.BLACK
    elif obj['imu'].address == 0x6c:
        if get_bmm150_status():
            obj['color'] = lcd.BLUE

    obj['buf'] = [[0, 0] for i in range(0, 6)]
    lcd.rect(65, 65, 60, 60, lcd.WHITE, lcd.WHITE)  # old pic dot clean