https://wiki.luatos.com/chips/air001/Air001-Arduino.html
使用国内的json,安装不仅成功率高还非常的快速。(当然取决于个人网络环境)
https://wiki.luatos.com/chips/air001/mcu.html#id4
✨
- 串口下载方式说明:
串口下载的接线为串口模块的RX接Air001的TXD(PA2),串口模块的TX接Air001的RXD(PA3),如果您希望能够自动下载的话,应当把DTR和RTS连接到串口模块上的对应引脚,芯片或者开发板的GND与串口模块的GND相连。- 如果您没有自动下载,那么在每次下载前需要手动进入 bootloader:
1.先按下 BOOT 按键不放(即拉高 BOOT0 引脚)
2.按一下RST按键
3.松开 BOOT 按键
下载完成后,可能需要手动按一下 RST 按键以复位正常运行
/*
Air001最小系统板
B0 --> green led
B1 --> red led
B3 --> blue led
*/
static volatile uint8_t led_flag = 0;
uint8_t Pin[] = { PB_1, PB_0, PB_3 };
void setup() {
// put your setup code here, to run once:
pinMode(PB_0, OUTPUT);
pinMode(PB_1, OUTPUT);
pinMode(PB_3, OUTPUT);
Serial.begin(115200);
Serial.printf("Hello, Air001. \n");
}
void loop() {
// put your main code here, to run repeatedly:
static int count = 0;
if (!led_flag) {
for (uint8_t i = 0; i < 3; i++) {
digitalWrite(Pin[i], HIGH);
delay(300);
}
led_flag = 1;
} else {
for (uint8_t j = 3; j > 0; j--) {
digitalWrite(Pin[j - 1], LOW);
delay(300);
}
led_flag = 0;
}
Serial.printf("NO.%d print. \n", count);
count++;
}