FastLED 3.10.10
Loading...
Searching...
No Matches
Polygon.ino File Reference

Detailed Description

Antialiased filled polygons with fl::CanvasRGB::drawPolygon.

Definition in file Polygon.ino.

#include <Arduino.h>
#include <FastLED.h>
#include <fl/gfx/gfx.h>
#include <fl/math/math.h>
+ Include dependency graph for Polygon.ino:

Go to the source code of this file.

Macros

#define HEIGHT   16
 
#define NUM_LEDS   (WIDTH * HEIGHT)
 
#define PIN_DATA   FL_PIN_CLOCKLESS_1
 
#define WIDTH   16
 

Typedefs

typedef fl::s16x16 Fix
 
typedef fl::PolyPoint< Fix > FixPt
 
typedef void(* SceneFn) (unsigned long t)
 

Functions

static fl::i32 angleAt (unsigned long t, unsigned long periodMs)
 
static void drawStar (float cx, float cy, float r, float spin, const CRGB &color)
 
void loop ()
 
static fl::i32 mulQ16 (fl::i32 a, fl::i32 b)
 
static FixPt polar (fl::i32 cx, fl::i32 cy, fl::i32 r, fl::i32 a)
 
static void sceneKnot (unsigned long t)
 
static void sceneLayers (unsigned long t)
 
static void scenePinwheel (unsigned long t)
 
static void sceneStar (unsigned long t)
 
void setup ()
 
static Fix wrap (fl::i32 a)
 

Variables

fl::CanvasRGB canvas (fl::span< CRGB >(leds, NUM_LEDS), WIDTH, HEIGHT)
 
static const fl::i32 kCX = WIDTH * kOne / 2
 
static const fl::i32 kCY = HEIGHT * kOne / 2
 
static const int kKnotN = 14
 
static const int kNumScenes = (int)(sizeof(kScenes) / sizeof(kScenes[0]))
 
static const fl::i32 kOne = 65536L
 
static const fl::i32 kPi = 205887L
 
static const fl::i32 kR = (WIDTH < HEIGHT ? WIDTH : HEIGHT) * kOne / 2
 
static const unsigned long kSceneMs = 5000
 
static const SceneFn kScenes [] = {scenePinwheel, sceneStar, sceneLayers, sceneKnot}
 
static const fl::i32 kTwoPi = 411775L
 
CRGB leds [NUM_LEDS]