Skip to content
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

Argo sendSensorTemp #1858

Merged
merged 7 commits into from
Aug 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/ir_Argo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,28 @@ void IRArgoAC::begin(void) { _irsend.begin(); }
void IRArgoAC::send(const uint16_t repeat) {
_irsend.sendArgo(getRaw(), kArgoStateLength, repeat);
}

/// Send current room temperature for the iFeel feature as a silent IR
/// message (no acknowledgement from the device).
/// @param[in] temp The temperature in degrees celsius.
/// @param[in] repeat Nr. of times the message will be repeated.
void IRArgoAC::sendSensorTemp(const uint8_t temp, const uint16_t repeat) {
uint8_t tempc = temp - kArgoTempDelta;
uint8_t check = 52 + tempc;
uint8_t end = 0b011;

ArgoProtocol data;
data.raw[0] = 0b10101100;
data.raw[1] = 0b11110101;
data.raw[2] = (tempc << 3) | (check >> 5);
data.raw[3] = (check << 3) | end;
for (uint8_t i = 4; i < kArgoStateLength; i++) data.raw[i] = 0x0;
uint8_t sum = IRArgoAC::calcChecksum(data.raw, kArgoStateLength);
data.raw[10] = 0b00000010;
data.Sum = sum;

_irsend.sendArgo(data.raw, kArgoStateLength, repeat);
}
#endif // SEND_ARGO

/// Verify the checksum is valid for a given state.
Expand Down
2 changes: 2 additions & 0 deletions src/ir_Argo.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ class IRArgoAC {

#if SEND_ARGO
void send(const uint16_t repeat = kArgoDefaultRepeat);
void sendSensorTemp(const uint8_t temp,
const uint16_t repeat = kArgoDefaultRepeat);
/// Run the calibration to calculate uSec timing offsets for this platform.
/// @return The uSec timing offset needed per modulation of the IR Led.
/// @note This will produce a 65ms IR signal pulse at 38kHz.
Expand Down