sacban
Junior Member level 3
- Joined
- Aug 20, 2015
- Messages
- 29
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 412
All Members Active,
I have problem to add more button, can anyone help me to give some guidance to solve this issue.
Below are my code :
रिसीवर
ट्रांसमीटर
:bsdetector::bsdetector::bsdetector:
Sacban.
I have problem to add more button, can anyone help me to give some guidance to solve this issue.
Below are my code :
रिसीवर
HTML:
char txt,txt1;
char hrd,hrd1;
char hmd,hmd1;
void main() {
TRISB.F0=0;
TRISB.F3=0;
TRISB.F4=0;
PORTB=0x00;
UART1_Init(9600);
delay_ms(120);
while(1){
if(UART1_Data_Ready() == 1){
hrd = UART1_Read();
if(hrd == 'Z'){
delay_ms(100);
hrd1 = UART1_Read();
if(hrd1 == 'X'){
delay_ms(100);
txt = UART1_Read();
if(txt == 'A'){
PORTB.F0=~PORTB.F0;
}else if(txt == 'A'){
PORTB.F0=~PORTB.F0;
}
}
//***************************************************//
if(UART1_Data_Ready() == 1){
hmd = UART1_Read();
if(hmd == 'Z'){
delay_ms(100);
hmd1 = UART1_Read();
if(hmd1 == 'X'){
delay_ms(100);
txt1 = UART1_Read();
if(txt1 == 'A'){
PORTB.F4=~PORTB.F4;
}else if(txt1 == 'A'){
PORTB.F4=~PORTB.F4;
}else{
}
}
}
}
}
}
}
}
ट्रांसमीटर
HTML:
int asu,asu1;
void main() {
asu =0;
asu1=0;
TRISA.F0=1; // RA0 As Input
TRISA.F1=1; // RA1 As Input
TRISB = 0x00; // Set To Output
PORTB=0x00; // Clear
UART1_Init(1200);
delay_ms(100);
while(1){
if(PORTA.F0 == 1){
asu = 1;
}
if(asu == 1 && PORTA.F0 == 0){
asu = 0;
if(UART1_Tx_Idle() == 1){
UART1_Write('Z');
UART1_Write('X');
UART1_Write('A');
}
}
if(PORTA.F1 == 1){
asu1=1;
}
if(asu1 == 1 && PORTA.F1 == 0){
asu1=0;
if(UART1_Tx_Idle() == 1){
UART1_Write('Z');
UART1_Write('X');
UART1_Write('A');
}
}
}
}
:bsdetector::bsdetector::bsdetector:
Sacban.