from machine import I2C, Pin
import ssd1306
from time import sleep
from imu import MPU6050
import time
x = None
y = None
i2cOLED=I2C(0, scl=Pin((1)), sda=Pin((0)))
oled_width = 128
oled_height = 64
oled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2cOLED)
i2cMPU6050=I2C(0, scl=Pin((1)), sda=Pin((0)))
imu = MPU6050(i2cMPU6050)
oled.fill(0)
oled.show()
oled.text('Hello', 0, 0)
oled.show()
time.sleep(1)
while True:
x = imu.accel.x
y = imu.accel.y
oled.fill(0)
oled.show()
oled.text((''.join([str(x2) for x2 in ['X:', x, ', Y:', y]])), 0, 20)
oled.show()
print(''.join([str(x3) for x3 in ['X:', x, ', Y:', y]]))
time.sleep(1)