Arduino Programming on LinkNode R4

1. Get started in Arduino programming

a. Requirements

Software:

Hardware:

  • 5V/1A DC power is recommended.
  • USB TTL UART cable

b. Install Arduino core for ESP8266

  • Open Boards Manager from Tools --> Board menu --> Boards Manager.

  • Search and install esp8266 platform (and don't forget to select your ESP8266 board from Tools --> Board menu after installation).

c. Check the configuration of Board

Because the LinkNode R4 has not been added into the offcial ESP8266 Arduino core repository yet, so you can't find this board on the boards list, but you can use the Generic ESP8266 Module, and select Flash Mode as QIO.

d. Create a Arduino Project

  • Enter the following source code and compile

/*Turn on and off the S3 relay in every second */

void setup()

  pinMode(12,OUTPUT);

  Serial.begin(9600);

}

void loop()

digitalWrite(12,HIGH);

Serial.println("Relay ON\n");

delay(1000);

digitalWrite(12,LOW);

Serial.println("Relay OFF\n"); delay(1000);

}

e. Test

  • Jump out the S5 on LinkNode R4 and select program via UART
  • Connect DC power to LinkNode R4
  • Connect USB TTL UART cable to UART port of LinkNode R4
  • Connnect the other side to PC
  • Check your serial port which your PC recognize
  • Click the **Upload* on Arduino IDE
  • After finished, jump out the S5 on LinkNode R4 and select boot from flash