File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,12 +181,6 @@ that way we can drastically reduce the power consumption of the device.
181181First we need to define the callback function
182182that will be called when the button is pressed.
183183
184- ``` c title="Define the LED1 pin and mode"
185- /* Define the LED1 pin and mode */
186- gpio_t led1 = GPIO_PIN (1 , 10 );
187- gpio_mode_t led1_mode = GPIO_OUT ;
188- ```
189-
190184``` c title="Define the button callback function"
191185/* This callback function will be called when the button state changes */
192186void button_callback (void * arg) {
@@ -202,9 +196,13 @@ void button_callback(void *arg) {
202196}
203197```
204198
205- Now we need to define the button pin and mode and initialize it.
199+ Now we need to define the button and led1 pin and mode and initialize it.
200+
201+ ```c {1-6, 27-33}
202+ /* Define the LED1 pin and mode */
203+ gpio_t led1 = GPIO_PIN(1, 10);
204+ gpio_mode_t led1_mode = GPIO_OUT;
206205
207- ```c {1-2, 26-27}
208206/* Define the button pin */
209207gpio_t button = GPIO_PIN(1, 2);
210208
You can’t perform that action at this time.
0 commit comments