How to quickly reading GPIO pin LOW/HIGH directly?

Paul H asked Oct 16,2020
0

I'm expecting to see the state of a pin that I'm reading to pull low for maybe 50 us and then back up to high. The original code running on an UNO/Nano code looks about like this:

while (((PIND & 0b00001000) >> 3) == 1) {
  // busy
}
while (((PIND & 0b00001000) >> 3) == 0) {
  // busy
}

I've attempted this with the standard function for reading the pin and it's just too slow I think.

What's the best way to replicate this on an ESP32? Thanks!


  • Your Answer(1)
Upload photo
You can only upload 5 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP
0 / 10000
    Browse other questions tagged or ask your own question.