#ifdef LED_BUILTIN
#undef LED_BUILTIN
#endif
#define LED_BUILTIN 2
#define LED_PIN 25
long counter = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
Serial.println("---------------------------------");
pinMode(LED_BUILTIN, OUTPUT);
pinMode(LED_PIN, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
static long t1 = 0;
if (millis() - t1 >= 250) {
t1 = millis();
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
}
static long t2 = 0;
if (millis() - t2 >= 500) {
t2 = millis();
digitalWrite(LED_PIN, !digitalRead(LED_PIN));
}
static long t3 = 0;
if (millis() - t3 >= 1000) {
t3 = millis();
Serial.println("Cnt: " + String(counter));
}
if (Serial.available() > 0) {
int value = Serial.parseInt();
if (value > 0)
{
Serial.print("Number: ");
Serial.print(value);
Serial.print(", hex: ");
Serial.print(value, HEX);
Serial.print(", bin: ");
Serial.println(value, BIN);
}
}
counter++;
}
Loading
cd74hc4067
cd74hc4067