Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
ir_Daikin.cpp
- Committer:
- alittera
- Date:
- 2019-05-27
- Revision:
- 9:4e06441ceecf
- Parent:
- 8:da53af1db462
File content as of revision 9:4e06441ceecf:
#include "IRremote.h"
#include "IRremoteInt.h"
//==============================================================================
//
//
// DAIKIN LITTERA
//
//
//==============================================================================
#define DYIRDAIKIN_FREQUENCY 38
//DAIKIN
#define DYIRDAIKIN_HDR_MARK 3600 //DAIKIN_ZERO_MARK*8
#define DYIRDAIKIN_HDR_SPACE 1600 //DAIKIN_ZERO_MARK*4
#define DYIRDAIKIN_ONE_SPACE 1300
#define DYIRDAIKIN_ONE_MARK 400
#define DYIRDAIKIN_ZERO_MARK 400
#define DYIRDAIKIN_ZERO_SPACE 428
// IR detector output is active low
#define MARK 0
#define SPACE 1
//+=============================================================================
//
void IRsend::daikinWarm ()
{
_pwm.write(0.5);
IRsend::custom_delay_usec(100);
_pwm.write(0.0);
IRsend::custom_delay_usec(5);
}
void IRsend::sendDaikin(unsigned char buf[], int len, int start) {
int data2;
daikinWarm();
enableIROut(DYIRDAIKIN_FREQUENCY);
mark(DYIRDAIKIN_HDR_MARK);
space(DYIRDAIKIN_HDR_SPACE);
for (int i = start; i < start+len; i++) {
data2=buf[i];
for (int j = 0; j < 8; j++) {
if ((1 << j & data2)) {
mark(DYIRDAIKIN_ONE_MARK);
space(DYIRDAIKIN_ONE_SPACE);
}
else {
mark(DYIRDAIKIN_ZERO_MARK);
space(DYIRDAIKIN_ZERO_SPACE);
}
}
}
mark(DYIRDAIKIN_ONE_MARK);
space(DYIRDAIKIN_ZERO_SPACE);
}
//+=============================================================================