Causing one event only

any idea how to go about it?

Yes. You are probably sending a value when the switch pin IS high, rather than when the switch pin GOES high. You need to keep track of the previous state of the switch, so that you can recognize when the state changes (when the switch is pressed and when the switch is released). Do something only at the transitions.