0

With 8051 Microcontroller, button that connected to P3_2. when I do:

 if(P3_2==1){ //One pressed button 
      //** Some LCD functions**//
    }

all good!

My thing is I want to get some others function when I 'Double Press' the button, But I don't know what is the code for

if(/*Perform double press*/){
   //** Some others LCD functions**//
 }

of course I use C code language for 8051. any idea? What is the code for the second if?

user694733
  • 15,208
  • 2
  • 42
  • 68
  • 3
    Most likely you need a counter variable to count number of presses. And maybe a timer to abandon presses with too long intervals. – user694733 Feb 05 '15 at 08:18
  • For simplicity you may write an another if withing your parent `if(P3_2==1){ if(P3_2==1){ //some code}` – smali Feb 05 '15 at 08:20
  • Hey, wondering where you buy the 8051 and external board? – Eric Feb 05 '15 at 08:31

0 Answers0