integrate IRBlaster into climate card
This commit is contained in:
parent
618f0b51e8
commit
81aa0c64f9
6 changed files with 60 additions and 50 deletions
29
ESPMegaPRO-OS-SDK/src/rmt_demo.cpp.disabled
Normal file
29
ESPMegaPRO-OS-SDK/src/rmt_demo.cpp.disabled
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include <ESPMegaProOS.hpp>
|
||||
#include <IRBlaster.hpp>
|
||||
#include <IRReceiver.hpp>
|
||||
|
||||
ESPMegaPRO espmega = ESPMegaPRO();
|
||||
IRBlaster irBlaster = IRBlaster(4);
|
||||
|
||||
uint16_t data[] = { 2441, 579, 621, 580, 620, 580, 620, 580, 621, 579, 621, 579, 1220, 580, 1220, 580, 1247, 554, 619, 580, 621, 580, 619, 581, 619, 26392, 2420, 580, 621, 580, 620, 579, 620, 581, 619, 581, 620, 580, 1219, 581, 1220, 580, 1220, 581, 619, 580, 620, 580, 620, 580, 621, 26385, 2421, 580, 621, 580, 620, 580, 620, 579, 621, 579, 621, 579, 1221, 579, 1221, 580, 1219, 580, 621, 580, 620, 580, 621, 579, 621, 26385, 2421, 580, 621, 579, 620, 580, 620, 580, 621, 579, 621, 579, 1221, 579, 1221, 580, 1219, 580, 621, 580, 620, 580, 620, 580, 621, 26384, 2422, 580, 621, 579, 621, 579, 620, 580, 620, 580, 621, 579, 1221, 579, 1221, 580, 1220, 580, 620, 580, 620, 579, 620, 581, 620};
|
||||
|
||||
void setup() {
|
||||
espmega.begin();
|
||||
IRReceiver::begin(15);
|
||||
|
||||
irBlaster.send(data, sizeof(data)/sizeof(uint16_t));
|
||||
}
|
||||
|
||||
void loop() {
|
||||
Serial.println("Starting long receive");
|
||||
IRReceiver::start_long_receive();
|
||||
delay(5000);
|
||||
Serial.println("Ending long receive");
|
||||
ir_data_t data = IRReceiver::end_long_receive();
|
||||
Serial.printf("Recived %d data points\n", data.size);
|
||||
for (size_t i = 0; i < data.size; i++) {
|
||||
Serial.print(data.data[i]);
|
||||
Serial.print(i == data.size-1 ? "\n" : ", ");
|
||||
}
|
||||
free(data.data);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue