We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c538047 commit 2cbf344Copy full SHA for 2cbf344
1 file changed
rpi_pico/samples/interrupt_sample/main.cpp
@@ -1,21 +1,22 @@
1
// Include local definition
2
-#include "duration.hpp"
3
-#include "outputpin.hpp"
+#include "picowrapper.hpp"
4
5
int main() {
+ PicoWrapper sdk;
6
+
7
// Use RasPi Pico on-board LED.
8
// 1=> Turn on, 0 => Turn pff.
9
const uint LED_PIN = PICO_DEFAULT_LED_PIN;
10
- // Initializing the GPIO pin and set it output.
11
- initialize_outputpin(LED_PIN);
+ sdk.gpio_init(LED_PIN);
12
+ sdk.gpio_set_dir(LED_PIN, true);
13
14
while (true) {
15
// Turn LED on
- put_outputpin(LED_PIN, 1);
16
- sleep_ms(duration());
+ sdk.gpio_put(LED_PIN, true);
17
+ sdk.sleep_ms(200);
18
// Turn LED off
- put_outputpin(LED_PIN, 0);
19
+ sdk.gpio_put(LED_PIN, false);
20
+ sdk.sleep_ms(800);
21
}
22
0 commit comments