hello my name is Max I`m from Mexico

I have a problem; Im building a remote control using RF with modulation ASK, at the beginning I try to turn on and turn off a led. and Iam using the pic 16f84a. To turn on the led i used a switch and the command serout example:

if sw1=1 then
serout datout,N2400,{5}
end

to turn off i used another switch an the command serout

if sw2=1 then
serout datout, N2400,{8}
endif

the first test works very good even a 50mts of distance.
But my problem is here: I try to turn on and turn off with the same switch but i cant do this, why? i have some theory about.
when i use a one SW only have 2 (obvius)on/off, when is off the serout send the data again and again and when the SW do the same. the RX recieve the data time and time again with this the program behaves very rare.


how i can to do the tx send only one time the code, even the sw still on or off during anytime?

the rx: code is like this

rx:
serin datin, N2400,dato
if dato =5 then
high led
endif

if dato=8 then
low led
endif


I was reading the command serin is able to compare the entrance variables, but i dont know how

please any have an idea??? help me


P.S. my english is too bad sorry i hope you understand my problem