|
@@ -1,7 +1,21 @@
|
|
|
+/*
|
|
|
+Author: Tobias Müller
|
|
|
+Date: 30.06.2023
|
|
|
+Version: 1.0
|
|
|
+
|
|
|
+Main file.
|
|
|
+*/
|
|
|
+
|
|
|
+////////////////////////////// Libraries //////////////////////////////
|
|
|
#include "header.h"
|
|
|
|
|
|
-int main() {
|
|
|
+////////////////////////////// Global Variable //////////////////////////////
|
|
|
+
|
|
|
+
|
|
|
+////////////////////////////// Main //////////////////////////////
|
|
|
+int main(void) {
|
|
|
|
|
|
+ ////////////////////////// Setup //////////////////////////
|
|
|
// Initialize LED pin
|
|
|
gpio_init(PICO_DEFAULT_LED_PIN);
|
|
|
gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT);
|
|
@@ -9,17 +23,28 @@ int main() {
|
|
|
// Initialize chosen serial port
|
|
|
stdio_init_all();
|
|
|
|
|
|
- int i = 0;
|
|
|
+ ////////////////////////// Local Variable //////////////////////////
|
|
|
+ int iter;
|
|
|
|
|
|
- // Loop forever
|
|
|
- while (true) {
|
|
|
+ ////////////////////////// Code //////////////////////////
|
|
|
+ // test function
|
|
|
+ bar();
|
|
|
+
|
|
|
+ // Loop for i-times
|
|
|
+ for(iter = 10; iter > 0; iter--) {
|
|
|
|
|
|
// Blink LED
|
|
|
- printf("Blinking!\r\n");
|
|
|
+ printf("Blinking %i-times!\r\n", iter);
|
|
|
gpio_put(PICO_DEFAULT_LED_PIN, true);
|
|
|
sleep_ms(SLEEP_TIME_MS);
|
|
|
gpio_put(PICO_DEFAULT_LED_PIN, false);
|
|
|
sleep_ms(SLEEP_TIME_MS);
|
|
|
- i++;
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////// Functions //////////////////////////////
|
|
|
+void bar(void) {
|
|
|
+
|
|
|
+ ////////////////////////// Code //////////////////////////
|
|
|
+ printf("Function bar");
|
|
|
}
|