// ================================================================================================= // // File....... jm_pixel24_nc_test.c // Purpose.... // Author..... Jon "JonnyMac" McPhalen // Copyright (c) 2023 Jon McPhalen // -- see below for terms of use // E-mail..... jon.mcphalen@gmail.com // Started.... // Updated.... 03 FEB 2023 // // ================================================================================================= enum { _clkfreq = 200_000_000 }; #include #include #define LEDS 32 // pixel control pin #define N_PIXELS 16 // pixels in strip/ring struct __using("jm_pixel24_nc") strip; // cogless 1-wire pixel driver long pixels[N_PIXELS]; // pixel buffer void main() { setup(); while(true) { timedFill(strip.scale(strip.RED, $02), 500); timedFill(strip.scale(strip.GREEN, $02), 500); timedFill(strip.scale(strip.BLUE, $02), 500); timedFill(strip.scale(strip.BLACK, $02), 500); } } void timedFill(uint32_t color, int fillMS) { int ch; for(ch = 0; ch < N_PIXELS; ch++) { strip.set(ch, color); strip.show(); _waitms(fillMS/N_PIXELS); } } void setup() { strip.start(LEDS, true, 75, 400, 800, &pixels, N_PIXELS); // WS2812b } /* Terms of Use: MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */