I am intergrating inputs and uart in PIC MCU. My program is if I press a switch, this info is send to terminal but the problem is it keep on displaying until I release the switch. I want it to be displayed just for once regardless of how much time switch is being pressed.
For ex:
while(1)
{
if(switch == pressed)
putsUART("switch 1 pressed");
}
Its just a pseudo code. This keep on displaying as it is in while(1) but is there any logic or some function which displays it for one time, and if some presses the switch again, it prints again for one time.