change blink to use PICO_DEFAULT_LED_PIN to support other boards (#57)
* change blink to use PICO_DEFAULT_LED_PIN to support other boards * also update pio/pwm and picoboard/blinky system/hello_double_tap
This commit is contained in:
parent
e77a4a84d1
commit
86ca3fec6c
@ -7,7 +7,7 @@
|
||||
#include "pico/stdlib.h"
|
||||
|
||||
int main() {
|
||||
const uint LED_PIN = 25;
|
||||
const uint LED_PIN = PICO_DEFAULT_LED_PIN;
|
||||
gpio_init(LED_PIN);
|
||||
gpio_set_dir(LED_PIN, GPIO_OUT);
|
||||
while (true) {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#include "pico/stdlib.h"
|
||||
#include "hardware/gpio.h"
|
||||
|
||||
const uint LED_PIN = 25;
|
||||
const uint LED_PIN = PICO_DEFAULT_LED_PIN;
|
||||
const uint DOT_PERIOD_MS = 100;
|
||||
|
||||
const char *morse_letters[] = {
|
||||
|
||||
@ -33,7 +33,7 @@ int main() {
|
||||
uint offset = pio_add_program(pio, &pwm_program);
|
||||
printf("Loaded program at %d\n", offset);
|
||||
|
||||
pwm_program_init(pio, sm, offset, 25);
|
||||
pwm_program_init(pio, sm, offset, PICO_DEFAULT_LED_PIN);
|
||||
pio_pwm_set_period(pio, sm, (1u << 16) - 1);
|
||||
|
||||
int level = 0;
|
||||
|
||||
Reference in New Issue
Block a user