Skip to content

Commit 2cbf344

Browse files
committed
PicoWrapper works well on RasPi Pico.
1 parent c538047 commit 2cbf344

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

  • rpi_pico/samples/interrupt_sample
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
// Include local definition
2-
#include "duration.hpp"
3-
#include "outputpin.hpp"
2+
#include "picowrapper.hpp"
43

54
int main() {
5+
PicoWrapper sdk;
6+
67
// Use RasPi Pico on-board LED.
78
// 1=> Turn on, 0 => Turn pff.
89
const uint LED_PIN = PICO_DEFAULT_LED_PIN;
910

10-
// Initializing the GPIO pin and set it output.
11-
initialize_outputpin(LED_PIN);
11+
sdk.gpio_init(LED_PIN);
12+
sdk.gpio_set_dir(LED_PIN, true);
1213

1314
while (true) {
1415
// Turn LED on
15-
put_outputpin(LED_PIN, 1);
16-
sleep_ms(duration());
16+
sdk.gpio_put(LED_PIN, true);
17+
sdk.sleep_ms(200);
1718
// Turn LED off
18-
put_outputpin(LED_PIN, 0);
19-
sleep_ms(duration());
19+
sdk.gpio_put(LED_PIN, false);
20+
sdk.sleep_ms(800);
2021
}
2122
}

0 commit comments

Comments
 (0)