Outils pour utilisateurs

Outils du site


esp8266:uart

Lecteur UART

En utilisant la lib EspSoftSerial on peut lire une entrée sur par ex la pin 13 (MOSI = 8 de l'UEXT sur la platine olimex ESP dev) heu j'ai la un pb .. ça marche bien sur une ESP-12 mais pas sur l' Olimex ESP-DEV ..

/* EspSoftSerial loopback example
Uses Serial1 transmitter on GPIO2 to transmit
Uses EspSoftSerial receiver on GPIO12 to receive
Scott Day 2015
github.com/scottwday/EspSoftSerial
*/
#include <EspSoftSerialRx.h>
EspSoftSerialRx serialRx;
void setup() {
   //Start the receiver on pin 13
   serialRx.begin(9600, 13);
   Serial.begin(9600);
}
void loop() {
  unsigned char b;
  while (serialRx.read(b))
    Serial.write((char)b);
 
 //Important weirdness: Call this at least once every 10 seconds
  serialRx.service();
  //Give the ESP a chance to do WiFi stuff
  delay(200);
}
esp8266/uart.txt · Dernière modification : 2024/02/09 17:10 de 127.0.0.1