34 lines
842 B
C++
34 lines
842 B
C++
#include <pico/stdio.h>
|
|
#include "pico/stdlib.h"
|
|
//#include "pico/cyw43_arch.h"
|
|
#include "Neopixel.pio.h"
|
|
#include <array>
|
|
#include "colors.hpp"
|
|
#include "hardware/pio.h"
|
|
#include "hardware/clocks.h"
|
|
#include <cstring>
|
|
|
|
constexpr uint8_t WS2812_PIN = 22;
|
|
|
|
std::array<pixel, 32> data;
|
|
|
|
extern "C"
|
|
int main() {
|
|
stdio_init_all();
|
|
data[0] = Coqui;
|
|
data[1] = Olivia;
|
|
data[2] = Meat;
|
|
data[3] = Callie;
|
|
memcpy(data.data()+4, data.data(), 4*sizeof(pixel));
|
|
memcpy(data.data()+8, data.data(), 8*sizeof(pixel));
|
|
memcpy(data.data()+16, data.data(), 16*sizeof(pixel));
|
|
// for (auto x : data)
|
|
// printf("%d ", x);
|
|
auto pio = pio0;
|
|
auto offset = pio_add_program(pio, &ws2812_program);
|
|
ws2812_program_init(pio, 0, offset, WS2812_PIN, 800000, false);
|
|
for (auto p : data)
|
|
pio_sm_put_blocking(pio, 0, p.get());
|
|
while (1);
|
|
}
|