diff --git a/Stub/.gitkeep b/Stub/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/Stub/neoPixel.c b/Stub/neoPixel.c new file mode 100644 index 0000000000000000000000000000000000000000..7a03acaf079b1e127050775d141cceb1dfbb2674 --- /dev/null +++ b/Stub/neoPixel.c @@ -0,0 +1,29 @@ +#include <stdio.h> +#include <stdlib.h> + +#include "pico/stdlib.h" +#include "hardware/pio.h" +#include "hardware/clocks.h" +#include "ws2812.pio.h" + +#define GPIO 28 + +static inline void setPixel(uint32_t pixel_grb) { + pio_sm_put_blocking(pio0, 0, pixel_grb * 256); +} + + //Todo make function which call a loop which fades from one clour to another + //use setPixel + //first 256 for white + //second 256 for green + //third 256 for red + //forth 256 for blue + +int main() { + stdio_init_all(); + uint offset = pio_add_program(pio0, &ws2812_program); + ws2812_program_init(pio0, 0, offset, GPIO, 800000, true); + while (1) { + //call subroutine + } +}