Closed bkeevil closed 4 years ago
If other boards are to get use of this feature, code will need to be adjusted. Why not make the flash code a menuconfig configuration value, like define the pin as -1 if not to be used? that way you can check #if CONFIG_FLASH_LED_PIN >= 0
and include the code. I would also add the LEDC channel, timer and so on needed for LEDC config to menuconfig.
And... flash is really only needed while vsync is active. That is actually when the image is capture by the sensor. Implementing that in software might be an issue though... will check what can be done in the driver.
oh and for the web page... you can check agains a known bad value and hide the control in javascript
@me-no-dev what is an example of a "known bad value"?
A flash could be added to any board really. It could also be used to control the intensity of an IR illuminator. Maybe rename flash->led
@me-no-dev re triggering on vsync: the LED needed to be turned on ~150 ms before a photo was taken to have the most effect. Presumably it takes that long to get to full brightness.
@me-no-dev what is an example of a "known bad value"?
If intensity goes from 0 to 100, then any value below 0 and above 100 will be a bad value, in which case the control can be hidden :)
@me-no-dev re triggering on vsync: the LED needed to be turned on ~150 ms before a photo was taken to have the most effect. Presumably it takes that long to get to full brightness.
150 us or ms? 150ms is a lot (a few frames), you might as well keep it on all the time ;)
Oh I see. There is no state data being sent with that page at all. It is stores as a gzip and adding state data would involve uncompressing it or sending data as an http header.
I think the best solution would be to modify the demo to serve a json file containing current camera state and retrieving it periodically from the main page with javascript.
On August 9, 2019 11:16:40 AM EDT, Me No Dev notifications@github.com wrote:
@me-no-dev what is an example of a "known bad value"?
If intensity goes from 0 to 100, then any value below 0 and above 100 will be a bad value, in which case the control can be hidden :)
@me-no-dev re triggering on vsync: the LED needed to be turned on ~150 ms before a photo was taken to have the most effect. Presumably it takes that long to get to full brightness.
150 us or ms? 150ms is a lot (a few frames), you might as well keep it on all the time ;)
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/espressif/esp-who/pull/104#issuecomment-519958073
-- Sent from my Android device with K-9 Mail. Please excuse my brevity.
this is how it actually works... when the page is loaded a json is retrieved from the server with the sensor state. Based on that state some controls are added, others are removed and proper state for all is set.
I missed that. I see it now. I will need to make some improvements to this patch then.
150 us or ms? 150ms is a lot (a few frames), you might as well keep it on all the time ;)
For video streams the flash stays on all the time. For stills the flash turns on and there is a vTaskDelay for 150 ms. At 100 ms the flash was visible but dim.
@me-no-dev the changes you wanted have been added as of 6a5f049 and the code compiles but I have not tested on any hardware yet. Will test tomorrow. Squashed all my commits.
I think I'm happy with this patch ea5abe5:
@XiaochaoGONG I may have lost your review when I rebased on your latest changes. Sorry. But your requested changes have been made.
Control the LED flash on AI Thinker boards from web control panel.
See issues #24 and #96
This replaces my previous pull request. I squashed some commits and renamed the branch this patch is in on my fork from development->Feature/AIThinker-Flash.