Skip to content

Instantly share code, notes, and snippets.

@elktros
Created March 29, 2021 09:39
Show Gist options
  • Save elktros/8cc40ece97ad6b26b611e21b27cc8f26 to your computer and use it in GitHub Desktop.
Save elktros/8cc40ece97ad6b26b611e21b27cc8f26 to your computer and use it in GitHub Desktop.
Test C Code for Raspberry Pi Pico New Project.
#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/gpio.h"
const uint LEDPIN = 25;
int main()
{
stdio_init_all();
gpio_init(LEDPIN);
gpio_set_dir(LEDPIN, GPIO_OUT);
while (1)
{
gpio_put(LEDPIN, 1);
sleep_ms(500);
gpio_put(LEDPIN, 0);
puts("Hello, World!\n");
sleep_ms(500);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment