Continuously cycle an RGB LED between bright and dim white
cmake_minimum_required(VERSION 3.3)
project(WS2812_Demo)
create_simple_executable(${PROJECT_NAME} WS2812_Demo.cpp)
const int delay = 40 * MILLISECOND;
while (1) {
unsigned int i;
for (i = 0; i < 0x101010; i += 0x010101) {
waitcnt(delay + CNT);
}
for (; i; i -= 0x010101) {
waitcnt(delay + CNT);
}
}
}