Guest User

Chahat Reply maxEmbedded

a guest
May 11th, 2013
80
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int S1; // assigning a variable S1
  2. int S2; // assigning another variable S2
  3.  
  4. S1=PINx&0b00000001; //Give your one input at first pin of x port
  5. S2=PINx&0b00000010; //Give your other input at second pin of x port
  6.  
  7. while(1)
  8. {
  9.     if(S1==1 && S2==2) //If both pins taking high input
  10.     { // operational code
  11.     }
  12. }
RAW Paste Data