我有一个Raspberry Pi作为WiFi热点和Arduino Uno尝试使用ESP8266模块从中获取数据。
这是我的Arduino接收器代码:#include
#include
#define sw_serial_rx_pin 4 // Connect this pin to TX on the esp8266
#define sw_serial_tx_pin 6 // Connect this pin to RX on the esp8266
#define esp8266_reset_pin 5 // Connect this pin to CH_PD on the esp8266, not reset. (let reset be unconnected)
SoftwareSerial swSerial(sw_serial_rx_pin, sw_serial_tx_pin);
// the last parameter sets the local echo option for the ESP8266 module..
SerialESP8266wifi wifi(swSerial, swSerial, esp8266_reset_pin, Serial);//adding Serial enabled local echo and wifi debug
String inputString;
boolean stringComplete = false;
unsigned long nextPing = 0;
void setup() {
swSerial.begin(9600);
Serial.begin(9600);
while (!Serial)
;
Seri
本文发布于:2024-02-04 21:22:16,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170716711359728.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |