hwthinker icon

Serial Test on ESP32 Dev module

hwthinker | PRO | 08/07/19 03:42:49 AM UTC | 0 ⭐ | 544 👁️ | Never ⏰ | []
Arduino |

760 B

|

None

|

0 👍

/

0 👎

// Note : 
// pastikan opsi tools-> flash mode pilih menjdi DIO,Qout atau Dout. Jangan Pilih QIO. 
//the setup function runs once when you press reset or power the board
// update by hwthinker
 
int counter = 0;
int state = 0;
int LED_BUILTIN=2;
void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(9600);
   // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.println("Test Serial and Built in LED on ESP32 by HwThinker: ");
  delay(2000);
}
 
 
void loop() {
   Serial.print("Test packet: ");
  Serial.println(counter);
  counter++;
 
  delay(1000);
  digitalWrite(LED_BUILTIN, (state) ? HIGH : LOW);
  state = !state;
  //or   digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
}

Comments