-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Freq. override; Freq. definitions for "1" (mark), "0"(space); Long delay critical fix #438
Conversation
…ing off of modulation added
Hey Andrey, Also, why are you setting a modulation frequency for the "space", which is inherently an "absence" of a signal, thus really has no modulation and thus, no modulation frequency. You may have a use case, it's just not obvious to me. Can you also expand on what the "Long delay issue" is with the NEC protocol encoding? |
FYI, you also have a number of code issues. e.g. The library tools & unit tests no longer compile.
i.e. Plus a bunch of code "style" issues:
|
Hi David
Frequency overriding was most generic method for me to achieve Turn-off modulation on output at all
So overriding mark frequency with “0” will turn modulation off
This case is useful, if output connected not to IR LED but to some input, which expect de-modulated signal (in some AV receivers for example or in-circut connection instead/after sensor)
Space frequency - result of attempt to integrate ESP with some king odd device where Space is coded by some another frequency (Multiroom module).
This is less useful then previous option, but defaults are working to keep normal behavior of library untouched.
It just becomes more flexible.
Regarding long delay issue - it looks like delayMicroseconds not working good enough for relatively long delays and this causes wrong IR header encoding for some protocols (NEC for example)
And as result, initial space shorter then expected. Normally it should be about 9 ms
Andrey
|
Ok. Thanks. I will check/fix it
|
Did you try playing with the duty cycle instead? i.e. setting it to 100(%). https://github.com/markszabo/IRremoteESP8266/blob/master/src/IRsend.cpp#L81 |
The more I think about it, having a |
Possibly, it should bring same result (but need to test)
In any cases, DutyCycle is parameter of enableIROut()
This function is invoked from almost all send<*> functions
And similar changes in enableIROut required to override dutyCycle, from passed from send<*> values to 100%
|
I agree, if we want to have a Back to the space frequency modulation. Are you saying that multi-room protocols some how encode "spaces" as pulses? (Which really means they are no longer spaces, but "marks") |
- Allow transmission frequency modulation to be turned off. - Better handle the case when a 100% duty cycle has been selected. - Slight refactor of mark() & space(). - Create & use our own delayMicroseconds() function. - Introduce an ledOn() function. - Create a new low-level unit test class for IRsend to allow low-level testing of mark() & space(). i.e. The software PWM emulation. - Unit test coverage for most of the above. - Based on discussions around PR #438
Hey Andrey, This should give you what you want. That is, a way to turn off frequency modulation(FM) completely when sending. It also has unit tests and fixes a few accidental/subtle bugs in this PR. It does not add an overriding FM option, as you haven't convinced me (yet) that is something that's really required or beneficial. David |
Thank you, David
It is enough for most generic cases
Freq. override I’m using in some integration/reverse engineering exercises (AV Receiver Harmann-Cordon, A-BUS protocol). Work is not done yet. Not sure, it will required finally.
Andrey
… On Mar 27, 2018, at 2:40 PM, David Conran ***@***.***> wrote:
Hey Andrey,
I've tried re-implementing most of what you suggested/requested in this PR in #439 <#439>
This should give you what you want. That is, a way to turn off frequency modulation(FM) completely when sending. It also has unit tests and fixes a few accidental/subtle bugs in this PR.
It does not add an overriding FM option, as you haven't convinced me (yet) that is something that's really required or beneficial.
David
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#438 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AVhOGbhXvNRORteBU2-reeAqnHNhqYvFks5tiiUbgaJpZM4S6XBR>.
|
- Allow transmission frequency modulation to be turned off. - Better handle the case when a 100% duty cycle has been selected. - Slight refactor of mark() & space(). - Create & use our own delayMicroseconds() function. - Introduce an ledOn() function. - Create a new low-level unit test class for IRsend to allow low-level testing of mark() & space(). i.e. The software PWM emulation. - Unit test coverage for most of the above. - Based on discussions around PR #438
I think this is obsolete now. |
overrideFreqs (freqMark, freqSpace) function added
-1 - no override(default)
0 - no modulation (to allow direct connection output to low-freq IR input)
if freqSpace >0 - filling space period by particular frequency (default=0 - no filling)
Long delay issue fixed both, for mark and space
Ref: https://www.arduino.cc/en/Reference/delayMicroseconds
Tested