Untitled
unknown
plain_text
a year ago
998 B
4
Indexable
Never
#include <stdio.h> #include <driver/gpio.h> #include <freertos/FreeRTOS.h> #include <freertos/task.h> #define LOW 0 #define HIGH 1 #define LED_PIN_EEN 19 #define LED_PIN_TWEE 20 #define LED_PIN_DRIE 21 #define LED_PIN_VIER 47 #define LED_PIN_VIJF 48 #define LED_PIN_ZES 45 #define LED_PIN_ZEVEN 0 #define LED_PIN_ACHT 35 #define LED_PIN_NEGEN 36 #define LED_PIN_TIEN 37 #define ARRAY(ARRAY) void app_main() { int LEDS[10] = {LED_PIN_EEN, LED_PIN_TWEE, LED_PIN_DRIE, LED_PIN_VIER, LED_PIN_VIJF, LED_PIN_ZES, LED_PIN_ZEVEN, LED_PIN_ACHT, LED_PIN_NEGEN, LED_PIN_TIEN}; unsigned Pattern = 0x80000000; for (uint16_t i = 0; i < 9; i++) { gpio_set_direction(LEDS[i], GPIO_MODE_OUTPUT); } while (1) { for (uint16_t i = 0; i < 9; i++) { int value = ((Pattern >> i) & 1) == 1; gpio_set_level(LEDS[i], value); } Pattern = Pattern >> 1; vTaskDelay(100 / portTICK_PERIOD_MS); } }