Skip to content

Commit 8807894

Browse files
author
smokeyser
committed
A little cleanup and edited comments
1 parent bd1c0be commit 8807894

2 files changed

Lines changed: 30 additions & 9 deletions

File tree

Codes.h

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,25 @@ long ydvd = 0x5EA1837C;
136136
long ycbl = 0x5EA12AD5;
137137
long yvcr = 0x5EA1F00F;
138138
long yaux = 0x5EA1AA55;
139-
long sonypwr = 0xA90;
139+
long sonypwr = 0xA90;
140+
141+
uint16_t cblPower[] = {
142+
200,
143+
840, 200,
144+
1680, 180,
145+
720, 200,
146+
2760, 200,
147+
1260, 200,
148+
1240, 200,
149+
1120, 200,
150+
2620, 200,
151+
12760, 200,
152+
840, 200,
153+
700, 200,
154+
700, 200,
155+
700, 200,
156+
700, 200,
157+
2780, 200,
158+
700, 200,
159+
700, 200,
160+
};

Remote2.ino

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@ int buttonState;
4545
int btnReading = 0;
4646

4747
int ledpin = 13;
48-
int a = ledpin;
4948

5049
// Uncomment for some extra output via serial
5150
// This makes the app almost 2 kb bigger
52-
// #define DEBUGGING
51+
#define DEBUGGING
5352

5453
void setup()
5554
{
@@ -81,7 +80,7 @@ void sendRawPulses(uint16_t *pulses, uint16_t pulseLength) {
8180
Serial.println(" pulses");
8281
#endif
8382
// sendRaw(array containing pulses, size of the array, frequency)
84-
irsend.sendRaw(pulses, pulseLength, 38);
83+
irsend.sendRaw(pulses, pulseLength, 39);
8584
}
8685

8786
void getButton() {
@@ -107,13 +106,14 @@ void getButton() {
107106
// Do stuff with that state
108107
switch (buttonState) {
109108
case BUTTON1:
110-
// Note that the size of raw pulses are calculated as
111-
// sizeof(arrayname) / sizeof(datatype)
112-
sendRawPulses(yamahaPwr, sizeof(yamahaPwr) / sizeof(uint16_t));
109+
// Note that the size of raw pulses (and arrays in general)
110+
// are calculated as sizeof(arrayname) / sizeof(datatype).
111+
sendRawPulses(cblPower, sizeof(cblPower) / sizeof(uint16_t));
112+
// delay(500);
113113
break;
114114
case BUTTON2:
115115
// Yamaha Volume Up using NEC code from the IRremote lib
116-
// size here is just code size (in bytes) * 8 bits per byte
116+
// size here is just code size (in bytes) * 8 bits per byte.
117117
irsend.sendNEC(yvup, sizeof(yvup) * 8);
118118
break;
119119
case BUTTON3:
@@ -126,7 +126,7 @@ void getButton() {
126126
Debouncing is skipped because the interrupt
127127
is disabled as soon as a button press is detected,
128128
and debouncing was causing issues. */
129-
delay(250);
129+
delay(100);
130130

131131
// Check if the button is being held down
132132
btnReading = analogRead(buttonPin);

0 commit comments

Comments
 (0)