|
本帖最后由 wwwusr 于 2018-5-18 19:30 编辑
千呼万唤,WiFiduijno板子终于到手。。。共试了两部分功能 ,IO, WiFi
1.从 https://www.arduino.cn/thread-76029-1-1.html 下载需要的文件,安装到默认位置,之后再打开IDE就能发现开发板里多出了 WiFiduino 。
2.板子就选 WiFiduino,没说的,其它的不用动,串口号要对应上。
3.先试试IO,懒,所以只用了8266的GPIO1,编译上传,正常开闪
[mw_shl_code=c,true]/*
Blink the blue LED on the WiFiduino
This example code is in the public domain
The blue LED on the module is connected to GPIO1
(which is also the TXD pin; so we cannot use Serial.print() at the same time)
Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
*/
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level
// but actually the LED is on; this is because
// it is active low on the ESP-01)
delay(1000); // Wait for a second
digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH
delay(2000); // Wait for two seconds (to demonstrate the active low LED)
}[/mw_shl_code]
blink
4.再试试wifi. 这里有问题,编译正常,但无法正常下载,需要在下载的时间手动按一下reset,还不一定每次都好使。。。
[mw_shl_code=c,true]/*
This sketch demonstrates how to scan WiFi networks.
*/
#include "ESP8266WiFi.h"
void setup() {
Serial.begin(115200);
// Set WiFi to station mode and disconnect from an AP if it was previously connected
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
Serial.println("Setup done");
}
void loop() {
Serial.println("scan start");
// WiFi.scanNetworks will return the number of networks found
int n = WiFi.scanNetworks();
Serial.println("scan done");
if (n == 0) {
Serial.println("no networks found");
} else {
Serial.print(n);
Serial.println(" networks found");
for (int i = 0; i < n; ++i) {
// Print SSID and RSSI for each network found
Serial.print(i + 1);
Serial.print(": ");
Serial.print(WiFi.SSID(i));
Serial.print(" (");
Serial.print(WiFi.RSSI(i));
Serial.print(")");
Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE) ? " " : "*");
delay(10);
}
}
Serial.println("");
// Wait a bit before scanning again
delay(5000);
}[/mw_shl_code]
WiFiscan
订单号 143905477566214594
|
|