Skip to content
Snippets Groups Projects
Commit 742c7eb7 authored by ch2g21's avatar ch2g21
Browse files

Merge branch 'main-patch-e121' into 'main'

added stub

See merge request !1
parents f644c30c f189bf66
No related branches found
No related tags found
1 merge request!1added stub
#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
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment