linux选择ubuntu发行版。
硬件设备有多小呢:

功能超级强大。
之前的ROS1和ROS2案例已经全部移植完成并测试结束(三轮纯人力校验😎)。
官网文档信息非常非常好:
html
https://docs.m5stack.com/zh_CN/quick_start/atoms3/arduino

下面开启,支持Linux+Windows+MacOS等。
M5Stack的板管理
1.打开 Arduino IDE,选择 文件
->首选项
->设置


2.复制下方的 M5Stack 板管理网址到 附加开发板管理器:
中
html
https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json


点击ok完成。
如果出现启动异常,如闪退等,请重新配置,或者重新安装arduino IDE,清空之前库,做好备份。
3.选择 工具
->开发板:
->开发板管理器...

4.在新弹出的对话框中,输入并搜索 M5Stack
,点击安装
(若出现搜索失败的情况,可以尝试重启Arduino程序)
注意:编译AtomS3至少需要2.0.6及以上版本,最新版2.0.7


下载过程依据网络情况,时间不确定,如果慢,请耐心+耐心+耐心。

5.选择 工具
->开发板:
->M5Stack Arduino
, 根据所使用的设备(M5Stack-ATOMS3
)选择对应的开发板配置.

本案例选择 M5stack-ATOMS3即可
相关库
不同的硬件设备,有着不同的案例程序库,请根据所使用的设备选择下载.打开 Arduino IDE, 然后选择 项目
->加载库
->库管理...

For ATOMS3
搜索 M5AtomS3
并安装,如下图所示, 下载时请根据弹窗提示,安装相关依赖库。

下载文件也比较多,需要耐心等待:

完成后(INSTALLED):


Hello World
复制下方代码到Arduino IDE, 将ATOM S3连接至PC并配置正确的端口(Tools
- > Port
- > COMx
), 点击菜单栏上的上传按钮(->
), 程序将会自动编译,上传至设备。 该程序将在LCD屏幕上显示"Hello World"字样。
Linux(ubuntu):
ttyACM0

cpp
#include "M5AtomS3.h"
/* After AtomS3 is started or reset the program in the setUp ()
function will be run, and this part will only be run once.
在 AtomS3 启动或者复位后,即会开始执行setup()函数中的程序,该部分只会执行一次。
*/
void setup() {
M5.begin(true, true, false,
false); // Init AtomS3(Initialize LCD, serial port).
// 初始化 AtomS3(初始化LCD、串口)
M5.Lcd.println("Hello World");
}
/* After the program in setup() runs, it runs the program in loop()
The loop() function is an infinite loop in which the program runs repeatedly
在setup()函数中的程序执行完后,会接着执行loop()函数中的程序
loop()函数是一个死循环,其中的程序会不断的重复运行 */
void loop() {
}
cpp
#include <M5AtomS3.h>
/* After M5AtomS3 is started or reset
the program in the setUp () function will be run, and this part will only be
run once. 在 M5AtomS3
启动或者复位后,即会开始执行setup()函数中的程序,该部分只会执行一次。 */
void setup() {
M5.begin(true, true, false, false); // Init M5AtomS3. 初始化 M5AtomS3
M5.Lcd.println("Hello ROS1/2 Robot");
}
/* After the program in setup() runs, it runs the program in loop()
The loop() function is an infinite loop in which the program runs repeatedly
在setup()函数中的程序执行完后,会接着执行loop()函数中的程序
loop()函数是一个死循环,其中的程序会不断的重复运行 */
void loop() {
M5.update(); // Read the press state of the key. 读取按键 A, B, C 的状态
if (M5.Btn.wasReleased() || M5.Btn.pressedFor(1000)) {
USBSerial.print('ROS');
M5.Lcd.print("ROS");
}
}

描述
AtomS3是一款基于ESP32-S3主控的高度集成的可编程控制器,集成了ESP32-S3的主控、集成WiFi功能和8M片上FLASH;0.85英寸IPS屏幕;屏幕底部的可编程按钮功能;内置5V至3.3V电路,6轴陀螺仪传感器MPU6886,板载Type-C接口,电源和固件下载,1个HY2.0-4P扩展端口,底部预留6个GPIO和电源引脚,方便扩展应用。产品尺寸仅为24*24mm,适用于各种嵌入式智能设备应用。
提醒:如果您需要刻录固件,请按住重置按钮(约2秒),直到内部绿色LED亮起,然后您可以释放它,此时设备已进入下载模式并等待刻录。
特点
- 基于ESP32-S3FN8开发
- 具有USB下载功能
- 内置3轴陀螺仪和3轴加速度计(MPU6886)
- 可编程按键
- 0.85(含)