Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 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));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement