Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > need help to solve muting problem in code"

Reply
Thread Tools

need help to solve muting problem in code"

 
 
alibaba
Guest
Posts: n/a
 
      01-31-2010
hi,
the problem is tat when i stand further from the tv,the muting
should be turn off but it does not turn off ,instead the word normal
appear on the tv and wait there forever,cant turn off the mute.
oblem to unmute my sony tv .my project is using infra distance sensor
to mute and unmute the tv,no buttons r required if input(pin_A3) is
high,the tv is mute ,if the input(pin_A3) is low,the tv is unmute but
my unmuting part is incorrect as the word normal keep on appearing on
the screen and the standby light on the sony tv is blinking repeatedly
when i add the unmute(); which is the reset command in the else loop
with delay_ms(1000).I do not know what is wrong with my programming.My
project should work this way,when i stand near the sensor ,the tv is
mute ,red led is turn off but when i stand further away the tv ,the tv
should be unmuted straighaway,red led is turn on and IR is turned
off.Please help me think of a solution on the unmuting part.THanks!
 
Reply With Quote
 
 
 
 
alibaba
Guest
Posts: n/a
 
      01-31-2010
On Jan 31, 4:06*am, alibaba <(E-Mail Removed)> wrote:
> hi,
> * *the problem *is tat when i stand further from the tv,the muting
> should be turn off but it does not turn off ,instead the word normal
> appear on the tv and wait there forever,cant turn off the mute.
> oblem to unmute my sony tv .my project is using infra distance sensor
> to mute and unmute the tv,no buttons r required if input(pin_A3) is
> high,the tv is mute ,if the input(pin_A3) is low,the tv is unmute but
> my unmuting part is incorrect as the word normal keep on appearing on
> the screen and the standby light on the sony tv is blinking repeatedly
> when i add the unmute(); which is the reset command in the else loop
> with delay_ms(1000).I do not know what is wrong with my programming.My
> project should work this way,when i stand near the sensor ,the tv is
> mute ,red led is turn off but when i stand further away the tv ,the tv
> should be *unmuted straighaway,red led is turn on and IR is turned
> off.Please help me think of *a solution on the unmuting part.THanks!

Below is the programming code for my prj.
#include<16F84A.H>
#fuses HS,NOWDT,NOPROTECT,PUT
#use DELAY(clock=20000000)

#define RED_LED
PIN_B3//(OUTPUT) RED led(TRUE)

#define RED_LED_ON output_low
(RED_LED)
#define RED_LED_OFF output_high
(RED_ LED)

#DEFINE pulse
PI_B2
#define pulse_high
output_low(pulse)
#define pulse_low
output_high(pulse)

#use fixed_io(b_output=PIN_B2,PIN_B3)
#use fast_IO (b)
use fast_IO (a)

#byte OPTION_REG=0x81
#bit PS0=OPTION_REG.0
#bit PS1=OPTION_REG.0
#bit PS2=OPTION_REG.0
#bit PSA=OPTION_REG.0
#bit T0SE=OPTION_REG.0
#bit T0CS=OPTION_REG.0
#bit INTEDG=OPTION_REG.6
#bit RBPU=OPTION_REG.7

Void send1_600()
{
pulse_high;
delay_us(14);
pulse_low;
delay_us(14);


pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14);



pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14);
pulse_high;
delay_us(14);
pulse_low;
delay_us(14);


pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14);

pulse_high;
delay_us(14);
pulse_low;
delay_us(14)
}

Void_send1_1200()
{
send1_600();
send1_600();
}

Void_send_srart_2400()
{
send1_1200();
send1_1200();
}

Void_send_0_600()
{
pulse_low;
delay_us(602);
}

Void mute() //this is the mute command
{
RED_LED_OFF;
send_start_2400();
send0_600();
send1_600();
send0_600();
send1_600();
send0_600();
send1_1200();
send0_600();
send1_600();
send0_600();
send1_1200();
send0_600();
send1_600();
send0_600();
send1_600();
send0_600();
send1_1200();
send0_600();
send1_600();
send0_600();
send1_600();
send0_600();
send1_600();
send0_600();
send1_600();
send0_600();
dalay_ms(25);
}

Void unmute() //this is the reset command
{
RED_LED_OFF;
send_start_2400();
send0_600( );
send1_600( );
send0_600( );
send1_1200( );
send0_600( );
send1_1200();
send0_600();
send1_600();
send0_600();
send1_1200();
send0_600();
send1_600();
send0_600();
send1_600();
send0_600();
send1_1200();
send0_600();
send1_600();
send0_600();
send1_600();
send0_600();
send1_600();
send0_600();
send1_600();
send0_600();
dalay_ms(25);
}

Void main(void)
{
//set_ tris_b(0xc2);
Set_tris_b(0xe0);
Set_tris_a(0x0c);

//RBPU=0;


while(1)
{
if(input(PIN_A3))
{
mute();
}
Else
{
Unmute();
Delay_ms(1000);
pulse_low;
}

}

}



 
Reply With Quote
 
 
 
 
Thad Smith
Guest
Posts: n/a
 
      02-01-2010
alibaba wrote:
> On Jan 31, 4:06 am, alibaba <(E-Mail Removed)> wrote:
>> hi,
>> the problem is tat when i stand further from the tv,the muting
>> should be turn off but it does not turn off ,instead the word normal
>> appear on the tv and wait there forever,cant turn off the mute.

....
>> off.Please help me think of a solution on the unmuting part.THanks!

> Below is the programming code for my prj.

[Snip CCS code for a PIC processor]

This is better addressed in comp.arch.embedded.

[off topic]
If you have determined that you are sensing the distance correctly, then your
problem appears to be that the IR code being sent to unmute is incorrect. If
you have access to an IR detector and a storage scope or logical analyzer,
monitor the pulse train of a remote control successfully performing an unmute,
then adjust your code accordingly. Compare the output of your code with the
corresponding output of the remote.

--
Thad
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XP keeps muting my microphone! thingy NZ Computing 33 07-09-2011 08:07 AM
Muting a screen saver Ken Windows 64bit 1 04-05-2010 07:49 PM
Re: XP keeps muting my microphone blanking NZ Computing 0 12-17-2007 08:54 PM
Muting sounds in MS Internet Explorer 7? XYZxyzee@AOL.COM Computer Information 2 11-20-2007 07:24 PM
SOUND CARD MUTING ON BOOT-UP Maurice Fleisher Computer Support 0 07-27-2006 10:29 AM



Advertisments