Új hozzászólás Aktív témák

  • Janos250

    őstag

    válasz gazso75 #11318 üzenetére

    Egy kis esp8266 Serial fejtágító, nem csak Neked:

    (Manoj R. Takoj : NodeMCU ESP8266 Communication Methods and Protocols)

    2.1 Serial Communication
    ESP8266 Serial works the same way as on a regular Arduino. Apart from
    hardware FIFO (128 bytes for TX and RX) Serial has additional 256-byte
    TX and RX buffers. Both transmit and receive is interrupt-driven. Write
    and read functions only block the sketch execution when the respective
    FIFO/buffers are full.
    Serial uses UART0, which is mapped to pins GPIO1 (TX) and GPIO3
    (RX).
    Example 1: Serial Data Transmission
    Program to send “Hello World” message to serial

    void setup () {
    Serial.begin(115200);
    }
    void loop(){
    Serial.println("Hello World");
    delay(500);
    }

    Amint látható, a Serialt nem kell példányosítani, mert előre példányosítva van, csak meg kell nyitni, és használni.

    "
    Serial1
    uses UART1, TX pin is GPIO2. UART1 cannot be used to receive
    data because normally its RX pin is occupied for flash chip connection. To
    use Serial1, call
    Serial1.begin(baudrate)
    .
    Example 3: Using Serial-1 (Only TX)
    After uploading program you will see blue led flashes due to data is
    getting sent on GPIO2(TX).

    "

Új hozzászólás Aktív témák

Hirdetés