// Blinks a single LED with a given frequency, based on pio_blink
// from the pico-examples repo.

#include "blink.pio.h"
#include "hardware/clocks.h"

void setup() {
  // put your setup code here, to run once:
  Serial1.begin(115200);
  Serial1.println("Hello, Raspberry Pi Pico!");
  int freq = 4;

  uint offset = pio_add_program(pio0, &blink_program);
  blink_program_init(pio0, 0, offset, 2);
  pio_sm_set_enabled(pio0, 0, true);

  printf("Blinking pin %d at %d Hz\n", 2, freq);
  pio0->txf[0] = clock_get_hz(clk_sys) / (2 * freq);
}

void loop() {
}
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT