1 | #include <stdio.h> |
2 | #include "pico/stdlib.h" |
3 | |
4 | |
5 | #define GPIOled 25
|
6 | |
7 | int count=0 ; |
8 | |
9 | void toggleLED(){ |
10 | printf("toggleLED()...\n") ; |
11 | gpio_init(GPIOled); |
12 | gpio_set_dir(GPIOled, GPIO_OUT); |
13 | while(1){ |
14 | gpio_put(GPIOled,1); |
15 | sleep_ms(200) ; |
16 | gpio_put(GPIOled,0); |
17 | sleep_ms(200) ; |
18 | printf("Hello, world! count=%d\n",count++); |
19 | }
|
20 | }
|
21 | |
22 | |
23 | |
24 | |
25 | int main(){ |
26 | stdio_init_all(); |
27 | toggleLED() ; |
28 | }
|