本帖最后由 qwe2079282957 于 2023-11-22 17:15 编辑
说到Arduino开发板,不用说,就是去Arduino官网下载软件了
https://www.arduino.cc/ 自行下载啊,点击software页面
选择自己系统的版本
just download就好,毕竟没钱赞助
Win7只能安装1.8版本,能用,其他系统最新版吧,安装过程,就是next,install,随意,搞不崩系统的
编译环境配置
1.打开软件,点击首选项,在附加开发板管理网址输入本地址获取脚本。
以下为本人帮运,勿喷
https://gitee.com/tanyemum/arduino-bouffalo/releases/download/1.0.5/package_bouffalolab_index.json
复制本地址,然后点击“好”即可
2.点击“工具”,“开发板。。。”,“开发管理器”,搜索BL618,点击“安装”即可,等自动下载完成
3.编译范例
以下引用github的
- #include <WiFi.h>
- int button_gpio = 33;
- int button_state = false;
- // Change the WIFI ssid and WIFI password below to yours.
- char *ssid = "your-ssid";
- char *password = "your-password";
- void setup() {
- Serial.begin(2000000);
- delay(10);
- // set LED output
- pinMode(LED_BUILTIN, OUTPUT);
- // set input key SW3
- pinMode(button_gpio, INPUT_PULLUP);
- WiFi.begin(ssid, password);
- // Will try for about 10 seconds (20x 500ms)
- int tryDelay = 500;
- int numberOfTries = 20;
- while (true) {
- switch(WiFi.status()) {
- case WL_NO_SSID_AVAIL:
- Serial.println("[WiFi] SSID not found");
- break;
- case WL_CONNECT_FAILED:
- Serial.print("[WiFi] Failed - WiFi not connected! Reason: ");
- return;
- break;
- case WL_CONNECTION_LOST:
- Serial.println("[WiFi] Connection was lost");
- break;
- case WL_SCAN_COMPLETED:
- Serial.println("[WiFi] Scan is completed");
- break;
- case WL_DISCONNECTED:
- Serial.println("[WiFi] WiFi is disconnected");
- break;
- case WL_CONNECTED:
- Serial.println("[WiFi] WiFi is connected!");
- Serial.print("[WiFi] IP address: ");
- // Serial.println(WiFi.localIP());
- return;
- break;
- default:
- Serial.print("[WiFi] WiFi Status: ");
- Serial.println(WiFi.status());
- break;
- }
- delay(tryDelay);
- if(numberOfTries <= 0){
- Serial.print("[WiFi] Failed to connect to WiFi!");
- // Use disconnect function to force stop trying to connect
- WiFi.disconnect();
- return;
- } else {
- numberOfTries--;
- }
- }
- }
- void loop() {
- button_state = digitalRead(button_gpio);
- if (button_state == LOW)
- {
- // Disconnect from WiFi
- Serial.println("[WiFi] Disconnecting from WiFi!");
- // This function will disconnect and turn off the WiFi (NVS WiFi data is kept)
- WiFi.disconnect();
- Serial.println("[WiFi] Disconnected from WiFi!");
- delay(1000);
- }
- digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
- delay(1000);
- digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
- delay(1000);
- }
复制代码
After writing and clicking Verify, if it doesn't report an error it means the installation is working.
清空文本框,复制代码到文本框 点击“项目”,“验证/编译”,出现黑框中文字时,说明环境配置完成了
|