Advertisement
Guest User

Untitled

a guest
Oct 24th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. void InitP0_14(){
  2.     PINSEL0 &= ~((1 << (2*14)) | (1 << (2*14+1)));    //already set to GPIO by default
  3.     IODIR0 &= ~_BIT(14);
  4. }
  5.  
  6. int main(void){
  7.     printf_init();
  8.     InitP0_14();
  9.     while(TRUE){
  10.         if ((IOPIN0 & (1<<14)) == 0){ // o== wcisniety
  11.             simplePrintf("Pressed");
  12.         } else {//puszczony
  13.             simplePrintf("Released");
  14.         }
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement