【小安派-UNO-ET485】Arduino开发板预环境安装及配置

[复制链接]
查看488 | 回复1 | 2023-11-22 17:14:32 | 显示全部楼层 |阅读模式
本帖最后由 qwe2079282957 于 2023-11-22 17:15 编辑

说到Arduino开发板,不用说,就是去Arduino官网下载软件了
https://www.arduino.cc/   自行下载啊,点击software页面
微信截图_20231122165835.png

选择自己系统的版本
微信截图_20231122165923.png 微信截图_20231122165931.png

just download就好,毕竟没钱赞助
微信截图_20231122165947.png
Win7只能安装1.8版本,能用,其他系统最新版吧,安装过程,就是next,install,随意,搞不崩系统的



编译环境配置

1.打开软件,点击首选项,在附加开发板管理网址输入本地址获取脚本。
以下为本人帮运,勿喷
https://gitee.com/tanyemum/arduino-bouffalo/releases/download/1.0.5/package_bouffalolab_index.json
复制本地址,然后点击“好”即可

微信截图_20231122170157.png 微信截图_20231122170229.png
2.点击“工具”,“开发板。。。”,“开发管理器”,搜索BL618,点击“安装”即可,等自动下载完成
1q.png

3.编译范例

以下引用github的

  1. #include <WiFi.h>

  2. int button_gpio = 33;
  3. int button_state = false;

  4. // Change the WIFI ssid and WIFI password below to yours.
  5. char *ssid     = "your-ssid";
  6. char *password = "your-password";

  7. void setup() {
  8.     Serial.begin(2000000);
  9.     delay(10);

  10.     // set LED output
  11.     pinMode(LED_BUILTIN, OUTPUT);
  12.     // set input key SW3
  13.     pinMode(button_gpio, INPUT_PULLUP);

  14.     WiFi.begin(ssid, password);
  15.     // Will try for about 10 seconds (20x 500ms)
  16.     int tryDelay = 500;
  17.     int numberOfTries = 20;

  18.     while (true) {
  19.         switch(WiFi.status()) {
  20.             case WL_NO_SSID_AVAIL:
  21.                 Serial.println("[WiFi] SSID not found");
  22.                 break;
  23.             case WL_CONNECT_FAILED:
  24.                 Serial.print("[WiFi] Failed - WiFi not connected! Reason: ");
  25.                 return;
  26.                 break;
  27.             case WL_CONNECTION_LOST:
  28.                 Serial.println("[WiFi] Connection was lost");
  29.                 break;
  30.             case WL_SCAN_COMPLETED:
  31.                 Serial.println("[WiFi] Scan is completed");
  32.                 break;
  33.             case WL_DISCONNECTED:
  34.                 Serial.println("[WiFi] WiFi is disconnected");
  35.                 break;
  36.             case WL_CONNECTED:
  37.                 Serial.println("[WiFi] WiFi is connected!");
  38.                 Serial.print("[WiFi] IP address: ");
  39.                 // Serial.println(WiFi.localIP());
  40.                 return;
  41.                 break;
  42.             default:
  43.                 Serial.print("[WiFi] WiFi Status: ");
  44.                 Serial.println(WiFi.status());
  45.                 break;
  46.         }
  47.         delay(tryDelay);

  48.         if(numberOfTries <= 0){
  49.           Serial.print("[WiFi] Failed to connect to WiFi!");
  50.           // Use disconnect function to force stop trying to connect
  51.           WiFi.disconnect();
  52.           return;
  53.         } else {
  54.           numberOfTries--;
  55.         }
  56.     }

  57. }

  58. void loop() {

  59.     button_state = digitalRead(button_gpio);
  60.     if (button_state == LOW)
  61.     {
  62.         // Disconnect from WiFi
  63.         Serial.println("[WiFi] Disconnecting from WiFi!");
  64.         // This function will disconnect and turn off the WiFi (NVS WiFi data is kept)
  65.         WiFi.disconnect();
  66.         Serial.println("[WiFi] Disconnected from WiFi!");
  67.         delay(1000);
  68.     }

  69.     digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  70.     delay(1000);
  71.     digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
  72.     delay(1000);

  73. }
复制代码



After writing and clicking Verify, if it doesn't report an error it means the installation is working.

清空文本框,复制代码到文本框
微信截图_20231122171045.png
点击“项目”,“验证/编译”,出现黑框中文字时,说明环境配置完成了



1q.png
回复

使用道具 举报

qwe2079282957 | 2023-11-22 17:16:23 | 显示全部楼层
个人操作,编译前,建议自己去gitee建个仓库,免得被人卡脖子
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则