arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.08k stars 4.78k forks source link

PWM pins RGB LED better support #941

Closed ageorgios closed 7 years ago

ageorgios commented 7 years ago

Are there any plans for better implementing RGB leds that rely on PWM pins?

It would be really great if the commands matched the Sonoff Led

arendst commented 7 years ago

Will be in next (pre)release.

It will also disable direct PWM control for H801 and MagicHome as it is then under control of commands Color and Dimmer.

nosaj66au commented 7 years ago

Hi Arendst, Would be great if we could name or title the channels and not have them as just RGB,W1,W2. I'm using one H801 per room giving me dimming control of 5 (24vdc) LED downlights. I using a spare GPIO as the switch like a normal sonoff. This either turns the LEDs off / Returns to last dimmer or went held 5 sec brings LEDs to full brightness. I guess there could be a heap of other options. What do you think? Jason

lobradov commented 7 years ago

I started working on similar code - are you refactoring xdrv_sfl? Can you share the idea, maybe we can split?

//_

On Oct 1, 2017, at 11:41, Theo Arends notifications@github.com wrote:

Will be in next (pre)release.

It will also disable direct PWM control for H801 and MagicHome as it is then under control of commands Color and Dimmer.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

arendst commented 7 years ago

I think the PWM code is complete as implemented in xdrv_snfled.ino.

Your IR code could go into xdrv_ir_send.ino. If need be I will transfer to other parts if you have something working.

lobradov commented 7 years ago

I was referring to adding color handling to MagicHome module and refactoring xdrv_snfled to allow more than 2 direct PWM channels.

Looked at that - seems current code depends on the snf_flg to determine number of channels and assumes that 1 or 2 channels are direct PWM, while 4 and 5 channels are controller via My92x1. I was thinking of changing the code to:

If you're shooting in a same direction, maybe we can split the work...

On 1 October 2017 at 16:19, Theo Arends notifications@github.com wrote:

I think the PWM code is complete as implemented in xdrv_snfled.ino.

Your IR code could go into xdrv_ir_send.ino. If need be I will transfer to other parts if you have something working.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/arendst/Sonoff-Tasmota/issues/941#issuecomment-333379749, or mute the thread https://github.com/notifications/unsubscribe-auth/AcWpOpSnffAFXkav8IlMVND4kCbiuuJqks5sn592gaJpZM4Ppm16 .

arendst commented 7 years ago

It's already there in the version released today. Just select MagicHome and you have full color control.

In fact any pwm controlled device can now be controlled that way once you enable this feature with command SetOption15 1

Further action will make the code too big while adding minor progression.

See releasenotes regarding correct pwm gpio selection.

lobradov commented 7 years ago

OK, just pulled latest version and see that you expanded the meaning of the snf_flg, which solves some issues. Let me check the rest of the code and see if anything's missing.

On 1 October 2017 at 21:28, Lazar Obradovic legend.no33@gmail.com wrote:

I was referring to adding color handling to MagicHome module and refactoring xdrv_snfled to allow more than 2 direct PWM channels.

Looked at that - seems current code depends on the snf_flg to determine number of channels and assumes that 1 or 2 channels are direct PWM, while 4 and 5 channels are controller via My92x1. I was thinking of changing the code to:

  • keep 5 component color code independent of the hardware implementation and use functions like dim, animate (transition) and rgb2hsb on it.
  • calculate PWM out of generic color model.
  • have a separate per-board configuration for determining controller method (direct PWM, WS2812, My92x1 or maybe something else if they come up with it)

If you're shooting in a same direction, maybe we can split the work...

On 1 October 2017 at 16:19, Theo Arends notifications@github.com wrote:

I think the PWM code is complete as implemented in xdrv_snfled.ino.

Your IR code could go into xdrv_ir_send.ino. If need be I will transfer to other parts if you have something working.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/arendst/Sonoff-Tasmota/issues/941#issuecomment-333379749, or mute the thread https://github.com/notifications/unsubscribe-auth/AcWpOpSnffAFXkav8IlMVND4kCbiuuJqks5sn592gaJpZM4Ppm16 .