From 69fdb35803679ac35d0be6ad61c7a5c2755844cc Mon Sep 17 00:00:00 2001 From: KurtMF Date: Thu, 28 Nov 2024 12:12:20 -0500 Subject: [PATCH] Simplified includes from last PR. Tweaked readme text. Added INSTALLATION.md advising users to pull latest release instead of main branch. --- INSTALLATION.md | 1 + ObjectFLED.h | 17 +---------------- OjectFLED.cpp | 4 ---- README.md | 20 ++++++++++---------- library.properties | 2 +- 5 files changed, 13 insertions(+), 31 deletions(-) create mode 100644 INSTALLATION.md diff --git a/INSTALLATION.md b/INSTALLATION.md new file mode 100644 index 0000000..c5beb6a --- /dev/null +++ b/INSTALLATION.md @@ -0,0 +1 @@ +The main branch is not always in a tested state. For installation, please download the [latest release](https://github.com/KurtMF/ObjectFLED/releases). Releases contain an ObjectFLED.zip file which is used to install in Arduino IDE: Sketch -> Include Library -> Add ZIP Library. \ No newline at end of file diff --git a/ObjectFLED.h b/ObjectFLED.h index e334445..1210a7e 100644 --- a/ObjectFLED.h +++ b/ObjectFLED.h @@ -38,23 +38,8 @@ #endif #ifndef ObjectFLED_h #define ObjectFLED_h -// #include +#include #include "DMAChannel.h" -#include "core_pins.h" - -// for DMAMEM -#include "pgmspace.h" - -// for NUM_DIGITAL_PINS and NUM_DIGITAL_PINS -#include "pins_arduino.h" - -#if !defined(NUM_DIGITAL_PINS) && !defined(USING_ARDUINO_FOR_TEENSY) -#define USING_ARDUINO_FOR_TEENSY 0 -#else -#define USING_ARDUINO_FOR_TEENSY 1 -#endif - - // Ordinary RGB data is converted to GPIO bitmasks on-the-fly using // a transmit buffer sized for 2 DMA transfers. The larger this setting, diff --git a/OjectFLED.cpp b/OjectFLED.cpp index 0a8f81d..5526375 100644 --- a/OjectFLED.cpp +++ b/OjectFLED.cpp @@ -57,10 +57,6 @@ GOIO9List = { 2, 3, 4, 5, 29, 33, 48, 49, 50, 51, 52, 53, 54 } //6 top, 7 botto #ifndef __IMXRT1062__ #error Only Teensy 4.x supported. #else - - -#include - #include "ObjectFLED.h" #ifndef MIN diff --git a/README.md b/README.md index 8ddd491..d9de555 100644 --- a/README.md +++ b/README.md @@ -123,16 +123,16 @@ object. Ex.- Called once in setup for the display object // Default timing 800KHz clock, 75uS latch delay -void ObjectFLED::begin(void); +begin(void); // Overclock default timing by the given factor -void ObjectFLED::begin(float OCF); +begin(float OCF); // Overclock default timing and overrde default latch delay -void ObjectFLED::begin(float OCF, uint16_t latchDelay); +begin(float OCF, uint16_t latchDelay); // Fully specify output waveform timing. NOTE: Given period, t0h, t1h are divided by given OCF. -void ObjectFLED::begin(float OCF, uint16_t period, uint16_t t0h, uint16_t t1h, uint16_t latchDelay); +begin(float OCF, uint16_t period, uint16_t t0h, uint16_t t1h, uint16_t latchDelay); - OCF = Overclocking factor multiples the clock rate (by dividing the pulse width values below) - period = nS time for duration of a full LED data pulse (from LED datasheet) NOTE: For 800KHz clock, @@ -168,9 +168,9 @@ See MAIN BENEFITS above for details. Brightness values 0-255. Brightness is applied by show() to frame buffer, not your drawing buffer. -* void setBrightness(uint8_t) +* setBrightness(uint8_t); -* uint8_t getBrightness() { return brightness; } +* getBrightness() { return uint8_t brightness; } ### setBalance(), getBalance() FUNCTIONS @@ -178,9 +178,9 @@ drawing buffer. Color Balance is 3-byte number in RGB order. Each byte is a brightness value for that color. Like brightness, this is applied by show() to frame buffer, not to your drawing buffer. -* void setBalance(uint32_t); +* setBalance(uint32_t); -* uint32_t getBalance() { return colorBalance; } +* getBalance() { return uint32_t colorBalance; } ## ACCESSORY FUNCTIONS @@ -188,7 +188,7 @@ Like brightness, this is applied by show() to frame buffer, not to your drawing These are not part of display objects, call them without object specifier. Unlike brightness and balance, these functions operate on your drawing buffer. -### void fadeToColorBy(void* leds, uint16_t count, uint32_t color, uint8_t fadeAmt); +### fadeToColorBy(void* leds, uint16_t count, uint32_t color, uint8_t fadeAmt); Fades drawing array towards the background color by amount. It is used just like FastLED's fadeToBlackBy(). @@ -197,7 +197,7 @@ fadeToBlackBy(). fadeToColorBy( myCube, 16*16*16, 0xFF8000, 20 ); //fades towards orange by 20/255ths -### void drawSquare(void* leds, uint16_t planeY, uint16_t planeX, int yCorner, int xCorner, uint size, uint32_t color); +### drawSquare(void* leds, uint16_t planeY, uint16_t planeX, int yCorner, int xCorner, uint size, uint32_t color); Safely draws box in given RGB color on LED plane. cornerY and cornerX specify the lower left corner of the box. It is safe to specify -cornerY, -cornerX, and safe to draw a box which only diff --git a/library.properties b/library.properties index aa500b9..a4730f5 100644 --- a/library.properties +++ b/library.properties @@ -2,7 +2,7 @@ name=ObjectFLED version=1.0.0 author=Kurt Funderburg maintainer=Kurt Funderburg -sentence=Independently configure and display to various LED devices in one sketch with DMA-driven LED output. +sentence=Independently configure and display to various LED devices in one sketch with parallel DMA-driven LED output. paragraph=Uses DMA transfer on all 40 or 55 pins of Teensy 4.0 or 4.1 to drive digital LEDs for display of FastLED arrays of CRGB, or other drawing buffer in RGB 3-byte format. The show() function is non-blocking, returning control to the graphics drawing code in just 6% of the time it takes to complete buffer transmission to an LED string, plane, or cube (tested with WS2812B, 1.6 overclock factor, 256 LED per pin x 16 pins = 4096 LEDs total @204 fps). category=Display url=https://github.com/KurtMF/ObjectFLED.git