42 lines
744 B
C
42 lines
744 B
C
#include "hardware/gpio.h"
|
|
//#include <stdio.h>
|
|
#include <pico/stdlib.h>
|
|
|
|
#define LED1_PIN 13
|
|
#define LED2_PIN 14
|
|
#define LED3_PIN 15
|
|
|
|
int main()
|
|
{
|
|
//stdio_init_all();
|
|
//printf("Hello, world!\n");
|
|
|
|
gpio_init(LED1_PIN);
|
|
gpio_init(LED2_PIN);
|
|
gpio_init(LED3_PIN);
|
|
|
|
gpio_set_dir(LED1_PIN, true);
|
|
gpio_set_dir(LED2_PIN, true);
|
|
gpio_set_dir(LED3_PIN, true);
|
|
|
|
gpio_put(LED1_PIN, true);
|
|
gpio_put(LED2_PIN, true);
|
|
gpio_put(LED3_PIN, true);
|
|
|
|
sleep_ms(3000);
|
|
|
|
while (true) {
|
|
gpio_put(LED1_PIN, true);
|
|
gpio_put(LED2_PIN, false);
|
|
gpio_put(LED3_PIN, false);
|
|
sleep_ms(500);
|
|
gpio_put(LED1_PIN, false);
|
|
gpio_put(LED2_PIN, true);
|
|
sleep_ms(500);
|
|
gpio_put(LED2_PIN, false);
|
|
gpio_put(LED3_PIN, true);
|
|
sleep_ms(500);
|
|
}
|
|
return 0;
|
|
}
|