//Author: eletechsup
//More information welcome to : http://www.485io.com 
//Arduino IDE 2.2.1
//DNLCB30 Expansion Board for ESP32 30PIN BOARD
//This code is to test whether the DNLCB30 ESP32 level converter board IO port has square wave output
//Note: 3(RX0)/34/35/36(VP)/39(VN) pin can only be used as an input pin


char i;

void setup() {                
  pinMode(15, OUTPUT);
  //pinMode(2, OUTPUT);//DNLCB30 does not have this port
  pinMode(4, OUTPUT);
  pinMode(16, OUTPUT);
  pinMode(17, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(18, OUTPUT);
  pinMode(19, OUTPUT);
  pinMode(21, OUTPUT);
  //pinMode(3, OUTPUT);//RX0  INPUT Only
  pinMode(1, OUTPUT);//TX0  INPUT Only
  pinMode(22, OUTPUT);
  pinMode(23, OUTPUT);
  //pinMode(39, OUTPUT);//VN INPUT Only
  //pinMode(36, OUTPUT);//VP INPUT Only
  //pinMode(34, OUTPUT);//INPUT Only
  //pinMode(35, OUTPUT);//INPUT Only
  pinMode(32, OUTPUT);
  pinMode(33, OUTPUT);
  pinMode(25, OUTPUT);
  pinMode(26, OUTPUT);
  pinMode(27, OUTPUT);
  pinMode(14, OUTPUT);
  //pinMode(12, OUTPUT);//DNLCB30 does not have this port
  pinMode(13, OUTPUT);
 
}
void loop() {  

digitalWrite(15, LOW);
digitalWrite(4, LOW);
digitalWrite(16, LOW);
digitalWrite(17, LOW);
digitalWrite(5, LOW);
digitalWrite(18, LOW);
digitalWrite(19, LOW);
digitalWrite(21, LOW);
digitalWrite(3, LOW);
digitalWrite(1, LOW);
digitalWrite(22, LOW);
digitalWrite(23, LOW);
digitalWrite(32, LOW);
digitalWrite(33, LOW);
digitalWrite(25, LOW);
digitalWrite(26, LOW);
digitalWrite(27, LOW);
digitalWrite(14, LOW);
digitalWrite(13, LOW);  

delay(10);

digitalWrite(15, HIGH);
digitalWrite(4, HIGH);
digitalWrite(16, HIGH);
digitalWrite(17, HIGH);
digitalWrite(5, HIGH);
digitalWrite(18, HIGH);
digitalWrite(19, HIGH);
digitalWrite(21, HIGH);
digitalWrite(3, HIGH);
digitalWrite(1, HIGH);
digitalWrite(22, HIGH);
digitalWrite(23, HIGH);
digitalWrite(32, HIGH);
digitalWrite(33, HIGH);
digitalWrite(25, HIGH);
digitalWrite(26, HIGH);
digitalWrite(27, HIGH);
digitalWrite(14, HIGH);
digitalWrite(13, HIGH);  

delay(10);

  
 
}
