Commit Graph

89 Commits

Author SHA1 Message Date
Gregg 536de53075 Added Stepper_TB6612 and Stepper_A3967 directly to HomeSpan
HomeSpan now includes both drivers as part of the "extras" functionality.
The StepperMotorControl Window Shade Example has been updated accordingly to use the built-in TB6612 driver.
2023-06-09 23:11:38 -05:00
Gregg 5e1d65f436 Renamed SpanStep to StepperControl and moved into HoneSpan Extras
Also updated StepperMotorControl Example.
2023-05-30 05:05:51 -05:00
Gregg 5daaf3d0cf Added #pragma once to extras header files 2022-12-03 11:12:30 -06:00
Gregg dbe4c268f4 Modified folder structure for "extras"
This allows the "src.ino" test file to once again properly compile without requiring modifications to any existing HomeSpan sketches.  This was needed to ensure src.ino can find object code in "extras", which is now required to use the new statusDevice() method.  Since the Arduino IDE only copies files that are in "src" folders, "extras" needed to be moved to "src/extras".  For backwards compatibility with all other sketches, the "extras" directory now contains stubs for the ".h" include files.
2022-09-24 08:20:22 -05:00
Gregg 8b9487b9d4 Created homeSpan.setStatusPixel(float h=0, float s=100, float v=100)
This is now the official API method to set an RGB NeoPixel as the status LED.  It defaults to bright red unless an HSV color is specified.
2022-09-04 07:31:08 -05:00
Gregg 546c87e3ec Added setOnColor to Pixel
Allows user to set the color to be used for Blinker
2022-09-03 16:47:02 -05:00
Gregg 355a2dfd4d Updated rest of code to reflect latest version of statusLED
Removed all checks to see if statusLED is defined, since it will now ALWAYS be defined, even if the statusDevice is set to NULL.
2022-09-02 18:47:15 -05:00
Gregg f2e1f5bc70 Updated Blinker Class to allow for NULL Blinkable Device
If NULL, all functions are ignored and getPin() returns -1
2022-09-02 18:15:53 -05:00
Gregg 6fecf2c29f updating main code to incorporate new Blinkable class/interface 2022-08-28 18:32:52 -05:00
Gregg 294b8d8d71 Complete re-write of Blinker Class
Rather than use ESP32 timers, simply spawn a new task that turn on/off LED using simple delays.  By avoiding the use of the ESP32 timer, we are no longer limited by the number of Blinkers possible.  Also, Blinker relied on the timer interrupt, which crashed when it tried to call Pixel since Pixel in turn uses interrupts from the RMT.  Switching to spawned tasks is much cleaner and does not consume more CPU time since the timer interrupts were driven by CPU anyway.

Blinker class and generic LED class are now in extras.h.  Blinkable Interface is also in extras.h.

To Do:  Incorporate new Blinker class into HomeSpan code
2022-08-28 17:49:48 -05:00
Gregg fc76db092d started development of Blinkable Interface to allow generic LED to be used with Blinker 2022-08-27 17:33:08 -05:00
Gregg d903fd7e97 Updated RFControl for compatibility with Arduino-ESP32 v 2.0.4
Needed to set idle_level to LOW even though idle_output was already disabled.  This is likely because 2.0.4 introduced an entirely new API for RMT, though version 2.0.3 IDF functions and structures seem to be accepted as well.
2022-07-23 15:16:43 -05:00
Gregg bb4b0e3dea Updates for ESP32-S3 Compatability
Added Feather.h mappings; and
Changed RMT clock logic in RFControl to check for presence of RMT_SYS_CON_REG instead of simply looking for CONFIG_IDF_TARGET_ESP32C3;

** NOTE:  Can ignore warnings about RMT_CH4...CH7+RX_LIM_REG redefine errors.  This has been reported to Espressif IDF Github, been acknowledged as a bug, and will be fixed in a future release of the IDF.  Since HomeSpan does NOT use the RMT peripheral for RECEIVING, these warning messages have no effect.
2022-06-11 07:56:42 -05:00
Gregg 02d841390c Updated License Dates 2022-02-20 13:05:03 -06:00
Gregg b141a83630 Update extras.ino 2022-02-19 18:29:34 -06:00
Gregg a83d3a7fda Added static HSV and RGB color methods to Pixel() and Dot()
Updated Pixel example to demonstrate use of the static HSV method
2022-02-17 18:27:31 -06:00
Gregg a4fb99a684 Updated Pixel Example 2022-02-13 11:57:34 -06:00
Gregg eee0eb6954 Embedded HSV and RGB methods inside Color object
Makes coding with Pixel() and Dot() easier
2022-02-12 15:31:55 -06:00
Gregg 9e40666231 Added Pixel() and Dot() operator overloads to Color struct
Color now supports a==b, a!=b, a+b, a-b, a+=b, and a-=b operators
2022-02-05 23:30:28 -06:00
Gregg acdcab1132 Verified Pixel() and Dot() classes work on ESP32-C3 2022-02-05 16:24:01 -06:00
Gregg d0a13e5417 Updated Pixel() class to use more streamlined methods implemented in Dot() class
Pixel() and Dot() classes are now complete.  Tested DotStar RGB, NeoPixel RGB, and NeoPixel RGBW, all running at same time on a single ESP32.

Next up: Must update Pixel Example as well as Holiday Lights Project
To Do: Add documentation page for Pixel() and Dot()
2022-02-05 12:35:01 -06:00
Gregg a21cc0679d Add two-wire addressable DotStar RGB LEDs to Pixel.h
Pixel.h now contains Pixel() and Dot() classes.
Dot() class uses more streamlined methods; must next update Pixel() to use similar methods, which will allow Pixel and Dot to be more "interchangeable".
2022-02-05 09:17:56 -06:00
Gregg d2bbd4f56c Added logic for RGB vs. RGBW
Tested with original 8-pixel RGB and 60-pixel RGBW.  Works as expected.
2022-01-29 18:26:17 -06:00
HomeSpan 877f47a64d Split RFControl constructor into public and private versions
Private constructor only used for Pixel, which is friend class of RFControl
2022-01-27 21:41:05 -06:00
Gregg a09b8d0b85 Update Pixel.cpp 2022-01-22 07:18:19 -06:00
Gregg 95b41fd929 Revert "Update logic so Pixel uses only ONE channel and shares across all instances"
This reverts commit 4af3a22764.
2022-01-22 07:09:48 -06:00
Gregg 4af3a22764 Update logic so Pixel uses only ONE channel and shares across all instances 2022-01-21 21:56:51 -06:00
Gregg e060856b78 corrected an issue in loadData ISR that would cause a hang
Also updated Pixel example with Knight Rider Effect.
Testing on C3 seems to be working.  Must test on S2 and ESP32 next.
2022-01-20 21:01:31 -06:00
Gregg 4419a91bef verified functionality on ESP32-S2 2022-01-17 13:15:24 -06:00
Gregg fd3955f0c2 verified functionality on ESP32 original 2022-01-17 12:52:09 -06:00
Gregg b6d21fd2c0 streamlined identification of interrupt masks and memory size 2022-01-17 12:36:02 -06:00
Gregg 89f0d0dd94 verified works on C3 when either channel 0 or 1 is used 2022-01-17 11:30:55 -06:00
Gregg 5f513c4c34 updated 2022-01-17 08:25:26 -06:00
Gregg 79c028c057 moved loadData into interrupt 2022-01-17 07:16:31 -06:00
Gregg 40c05bd53f some more cleanup
Next up:  Move loadData into isrHandler, if possible.
To Do: redo single-color methods
2022-01-16 23:24:54 -06:00
Gregg 1a99df4214 check in progress 2022-01-16 23:14:12 -06:00
Gregg 46d7ade046 Re-doing Pixel class once again
This time using customized interrupts to fill RMT memory on-the-fly.

* Added getChannel() to RFControl
* Add 3rd, optional, boolean argument to RFControl(int pin, bool refTick, bool defaultDrive) to that RMT can be initialized but without the default driver (allows for use of custom interrupt code instead)
2022-01-16 14:16:52 -06:00
Gregg aefa737675 Completed "optimization"
Pixels now lets you reserve memory for pixels so that the call to start the RF transmission can be done for multiple pixels at once.  However, gain is not as much as expected.  May need to revisit if driving a large matrix of pixels is needed.
2022-01-08 17:28:43 -06:00
Gregg ee6c270de3 optimizing to allow for pulse train batching 2022-01-08 16:18:37 -06:00
Gregg 9d0c56799c Update extras.ino 2022-01-07 06:58:40 -06:00
Gregg 1b402b5ebc changed range of S and V to be 0-100 instead of 0-1
But still use float so that values of 50.3, 99.5, etc. are still distinguishable.
2022-01-07 06:25:11 -06:00
Gregg 3020b800a6 testing 2022-01-06 21:43:54 -06:00
Gregg f10f5cffcd Normalized and optimized Pixel methods
created color_t typedef and use as basis for all RGB and HSV methods
2022-01-06 21:15:03 -06:00
Gregg d5b27d6e14 Added ability to set same color on multiple pixels
Added 4th, optional argument, nPixels, to setRGB() and setHSV().
2022-01-06 18:09:22 -06:00
Gregg 5d3a4bfc38 Added simple Pixel example to Other Examples 2022-01-01 08:14:32 -06:00
Gregg 12c283e8c3 Update Pixel.h 2022-01-01 07:14:30 -06:00
Gregg 368a06301a renamed sk68xx class to Pixel and made it generic
Constructor now allows you to specify high/low timings for 1-bit and 0-bit, as well as timing for reset delay.  Default parameters are included if none are specified.
2021-12-31 18:10:51 -06:00
Gregg 3b6bc13b1c Added setHSV() to sk68xx class 2021-12-31 15:34:20 -06:00
Gregg facba4c02a Added Pixel.h and Pixel.cpp and implemented SK68XX Addressable LED Class
Also add getPin() to RFControl (which is used by SK68XX Class) as well as boolean operator overrides for both RFControl and PwmPin/ServoPin so that instances can be checked for validity.
2021-12-31 14:51:42 -06:00
HomeSpan 82d86001e2 Update extras.ino 2021-10-16 14:49:50 -05:00