It is weird to ask but could you help me to register the button press. I am able to detect the button debounce. But what I am looking is once button pressed the mic take that button as pressed until I press other button.
The project is to display the received string(which is in terms of tonne) onto GLCD via EUSART . I have implemented the code to change the received string to kilo newton. Once button pressed I want to display only kilo newton value not the one I am receiving. To do so I have to register button press.
I have implemented a Switch case to perform specific task when respective button has been pressed
Code:
unsigned int unit=1;
if (Button1()){
if (unit=4) unit=1;
unit +=1;
}
switch(unit){
case 1: PutChar('1'); break;
case 2: PutChar('2'); break;
case 3: PutChar('3'); break;
case 4: PutChar('4'); break;
}
}