Update Extras.md

This commit is contained in:
HomeSpan 2020-12-27 18:44:12 -06:00 committed by GitHub
parent b9656fea37
commit 15c36e8784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 7 deletions

View File

@ -48,19 +48,23 @@ The ESP32 has an on-chip signal-generator peripheral designed to drive an RF or
Creating an instance of this **class** initializes the RF/IR signal generator and specifies the ESP32 *pin* to output the signal. You may create more than one instance of this class if driving more than one RF/IR transmitter (each connected to different *pin*).
Signals are defined as a sequence of pulses, where you specify the duration, in *ticks*, of paired high/low periods of a each pulse in a pulse train, shown respectively as H1-H4 and L1-L4 in the diagram below.
Signals are defined as a sequence of HIGH and LOW phases that together form a pulse train where you specify the duration, in *ticks*, of each HIGH and LOW phase, shown respectively as H1-H4 and L1-L4 in the diagram below.
![Pulse Train](images/pulseTrain.png)
Since most RF/IR signals repeat the same train of pulses more than once, the duration of the last LOW period should be extended to account for the delay between repeats of the pulse train. The following methods are used to construct the pulse train, set the number of repeats, set the duration of a *tick*, and start the transmission:
Since most RF/IR signals repeat the same train of pulses more than once, the duration of the last LOW phase should be extended to account for the delay between repeats of the pulse train. The following methods are used to construct the pulse train, set the number of repeats, set the duration of a *tick*, and start the transmission:
* `static void phase(uint16_t numTicks, uint8_t phase)`
* appends either a HIGH or LOW phase to the pulse train memory buffer, which has room to store a maximum of 1023 phases. Requests to add more than 1023 phases are ignored, but raise a non-fatal warning message. Note that this is a class-level method as there is only one pulse train memory buffer that is **shared** across all instances of the RFControl object
* *numTicks* - the duration, in *ticks* of the pulse phase. Allowable range is 1-32767 ticks. Requests to add a pulse with *numTicks* outside this range are ignored, but raise non-fatal warning message
* *phase* - set to 0 to create a LOW phase; set to 1 (or any non-zero number) to create a HIGH phase
* `static void add(uint16_t onTime, uint16_t offTime)`
* appends a new pulse to the pulse train memory buffer, which has room to store a maximum of 511 high/low pulses. Requests to add more than 511 pulses are ignores but raise a non-fatal warning message. Note that this is a class-level method—there is only one pulse train memory buffer that is **shared** across all instances of an RFControl object
* *onTime* - the duration, in *ticks* of the high portion of the pulse. Allowable range is 1-32767 ticks. Requests to add a pulse with an *onTime* outside this range are ignored but raise non-fatal warning message
* *offTime* - the duration, in *ticks* of the low portion of the pulse. Allowable range is 1-32767 ticks. Requests to add a pulse with an *offTime* outside this range are ignored but raise non-fatal warning message
* a convenience function that create a single HIGH/LOW pulse. Implemented as `phase(onTime,HIGH); phase(offTime,LOW);` as defined above, and subject to all the same limits and error-checks
* `static void clear()`