File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -136,29 +136,35 @@ To detach the interruption from a specific pin, use the ``detachInterrupt`` func
136136.. _gpio_example_code :
137137
138138Example Code
139- -------------
139+ ------------
140140
141- Here is the full code for the GPIO application example.
141+ GPIO Input and Output Modes
142+ ***************************
142143
143- .. code-block ::
144+ .. code-block :: arduino
144145
145146 #define LED 12
146147 #define BUTTON 2
147-
148+
148149 uint8_t stateLED = 0;
149-
150+
150151 void setup() {
151152 pinMode(LED, OUTPUT);
152153 pinMode(BUTTON,INPUT_PULLUP);
153154 }
154155
155156 void loop() {
156-
157+
157158 if(!digitalRead(BUTTON)){
158159 stateLED = stateLED^1;
159160 digitalWrite(LED,stateLED);
160161 }
161162 }
162163
163- .. _Wokwi : https://wokwi.com/
164+ GPIO Interrupt
165+ **************
166+
167+ .. literalinclude :: ../../../libraries/ESP32/examples/GPIO/GPIOInterrupt/GPIOInterrupt.ino
168+ :language: arduino
169+
164170.. _datasheet : https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf
You can’t perform that action at this time.
0 commit comments