USB Serial Port Serial
Hardware Serial Port 1 Serial
Hardware Serial Port 2 Serial2
Sample Code1: D0&D1 refers to Serial, serial2 refers to Serial2. Users can use USB serial
transformer tools to check printing.
void setup() { // put your setup code here, to run once:
Serial.begin(115200);
Serial2.begin(115200);
}
void loop() { // put your main code here, to run repeatedly:
Serial.println("I am Serial");
Serial2.println("I am Serial 2");
delay(1000);
}
Result1: Use USB serial transforming board to receive data from Serial2 and you can check
printing in correspond in PC.
Sample Code2: Digital IO
int pin;
void setup() { // put your setup code here, to run once:
for(pin=24;pin<32;pin++){
pinMode(pin,OUTPUT);
}
}
void loop() { // put your main code here, to run repeatedly:
for(pin=24;pin<32;pin++){
digitalWrite(pin,HIGH);