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:
Ha Thach 2021-02-22 22:08:12 +07:00 committed by Graham Sanderson
parent e77a4a84d1
commit 86ca3fec6c
3 changed files with 3 additions and 3 deletions

View File

@ -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) {

View File

@ -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[] = {

View File

@ -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;