How to output a variable directly to GPIO pins ... i.e. in parallel.
This can be done using the ESP32's registers.
// sending a variable to GPIO pins Bitwise register style // create a parallel GPIO bus using GPIO 12,13,14,15 i.e. must be consecutive pins int RGBled=000; // demo RGB connected to Gpio pin 12,13,14,15 void setup() { // set the digital pin as outputs: void loop() { RGBled++; void parallel_write(uint8_t value) { |
Using this method simplifies/illiminates multiple writes to each GPIO in turn.