M5 Stack SeriesのAtom LiteでUIFlowを使ってGPSを動かしてみました。

最初の初期設定までの流れはこちらをご確認ください。
設定が終わったら、Atom LiteにGPSをつないでPCへ接続します。

UIFlowにアクセスします。
※今回、言語は英語にしています。
なお、verは変更せずにこのままで設定していきます。

まず、左下のUnitの+マークをクリックし、GPSを選択します。
ポートはAを使用しているので、今回はそのままにしておきます。


ブロックを用意して下記のように配置して、実行ボタン(▶Run)をクリックします。
なお、今後そのままの値で場所を検索することができるように頑張って度分秒表示にしています。
・Event > Loop
・Units > GPS > get gps_0 time
・Units > GPS > get gps_0 longitude
・Units > GPS > get gps_0 latitude
・Units > GPS > get gps_0 positioning quality
・Variables > set 〇 to
・Variables > 〇
・Math > 〇
・Math > Convert to float
・Math > Convert to int
・Math > round/round up/round down
・Math > + / - / × / ÷
・Timer > Wait 〇s
・Text > Print
・Text > " "
・Text > +のブロック
・Text > in text 〇 の、以下の数字番目の文字/の、後ろから以下の数字番目の文字/
最初の文字を得る/最後の文字を得る/ランダムな文字を得る
・Text > trim 〇 from both side/left side/rigt side of 〇

実行結果はTerminalをクリックしてリンクマークよりポートを選択すると確認することができます。(緯度経度はかなり正確なのでマスキングしました。)



なお、Pythonのほうのコードは下記のようになっています。

参考にした記事
M5 STACK GPS Document
Comments