mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-07-09 22:08:42 +02:00
Update chap 8
This commit is contained in:
@@ -1,11 +1,23 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "pico/stdlib.h"
|
#include "pico/stdlib.h"
|
||||||
|
|
||||||
|
#define LED_PIN 25
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
uint8_t age;
|
uint8_t age;
|
||||||
|
|
||||||
stdio_init_all();
|
stdio_init_all();
|
||||||
|
|
||||||
while (true)
|
gpio_init(LED_PIN);
|
||||||
|
gpio_set_dir(LED_PIN, GPIO_OUT);
|
||||||
|
|
||||||
|
while (true) {
|
||||||
printf("age: %d\r\n", age);
|
printf("age: %d\r\n", age);
|
||||||
|
|
||||||
|
gpio_put(LED_PIN, 1);
|
||||||
|
sleep_ms(500);
|
||||||
|
|
||||||
|
gpio_put(LED_PIN, 0);
|
||||||
|
sleep_ms(500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user