I have code in Micropython to communicate with the GPS unit connected to port A (because I use plain Gray M5Stack unit) and using Thonny editor.
If I upload code directly to the device a run it from the menu, it works well. But if I try to run it directly from Thonny editor (it uses REPL mode I guess), I got this error:
Unit: Please change unit gps to other grove
It is very simple code and it looks like this:
import os
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
gps0 = unit.get(unit.GPS, unit.PORTA)
label0 = M5TextBox(92, 85, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label1 = M5TextBox(92, 70, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
while True:
label0.setText(str(gps0.pos_quality))
label1.setText(str(gps0.satellite_num))
wait_ms(2)
Do you have any tips?