Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
AtomSoft said:Its for my surround sound not a TV... And The Command is 0x00 for the 1 button and the device code which i assume to be the address is 0x0D
Nigel Goodwin said:Presumably this is a Sony SIRC's remote?, as you say the numeric button codes are one less than their labelled value.
I've not seen a device ID of 0x0D, it wasn't amongst the remotes I tested, but is perfectly possible.
AtomSoft said:Its for my surround sound not a TV... And The Command is 0x00 for the 1 button and the device code which i assume to be the address is 0x0D
// 37.7kHZ PWM IR carrier signal
#include <p18f1320.h>
#include <delays.h>
#pragma config WDT = OFF,OSC = INTIO2,LVP = OFF
void Delay10TCYx(PARAM_SCLASS unsigned char);
void Delay100TCYx(PARAM_SCLASS unsigned char);
void Delay1KTCYx(PARAM_SCLASS unsigned char);
void Delay10KTCYx(PARAM_SCLASS unsigned char);
void MyL0(void);
void MyL1(void);
void main(void) {
OSCCON=0x72; // speed up the clock to 8MHz
ADCON1 = 0;
TRISBbits.TRISB3 = 0;
PR2 = 0b00110100 ;
T2CON = 0b00000100 ;
CCPR1L = 0b00011010 ;
CCP1CON = 0b00011100 ;
while(1) {
///////////////////////////////////////
//////// Start Bit
/////////////////////////////////////////
CCPR1L = 0x1A; // Start
CCP1CON = 0x1C ; // 50%
Delay1KTCYx(4);
Delay100TCYx(8);
CCPR1L = 0x00; //Space
CCP1CON = 0x0C ; // 0%
Delay1KTCYx(1);
Delay100TCYx(2);
//////////////////////////////////////////
///////// Command Code
////////////////////////////////////////
MyL0();
MyL0();
MyL1();
MyL0();
MyL0();
MyL1();
MyL0();
////////////////////////////////////////////
///////// Below is DEVICE CODE
///////////////////////////////////////////
MyL1();
MyL0();
MyL0();
MyL0();
MyL0();
//////////////////////////////////////////////
//////// Just a wait to restart send /////////
//////////////////////////////////////////////
Delay1KTCYx(4);
}
}
void MyL0(void){
CCPR1L = 0x1A; // 0
CCP1CON = 0x1C ; // 50%
Delay1KTCYx(1);
Delay100TCYx(2);
CCPR1L = 0x00; //Space
CCP1CON = 0x0C ; // 0%
Delay1KTCYx(1);
Delay100TCYx(2);
}
void MyL1(void){
CCPR1L = 0x1A; // 1
CCP1CON = 0x1C ; // 50%
Delay1KTCYx(2);
Delay100TCYx(4);
CCPR1L = 0x00; //Space
CCP1CON = 0x0C ; // 0%
Delay1KTCYx(1);
Delay100TCYx(2);
}
blueroomelectronics said:Do you have a video camera? Most of them see IR and will let you see it too. Might be handy.
AtomSoft said:Im using a end delay of 10,000 cycles which is 50 ms... 45ms is recommended in between sends so i added 5 for cleanliness.
I used the cam to see if LED is on and it looks solid..like its doesnt blink but i assume thats because its so fast. Its shows like a slight dim and back on