Advertisement
kneefer

pic - smiw

Nov 24th, 2014
2,585
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pic 16 0.47 KB | None | 0 0
  1.     #include p18f87k22.inc
  2.    
  3.     bcf INTCON2, RBPU ;rezystory ustawiane indywidualnie
  4.     clrf PORTB
  5.     bsf TRISB, RB0 ; rezystor podciagajacy dla przycisku - PB0 jako wejscie
  6.    
  7.     bcf TRISB, RB5  ;gaszenie nieuzywanych LED
  8.     bcf TRISB, RB4
  9.     bcf PORTB, RB5
  10.     bcf PORTB, RB4
  11.    
  12.     clrf PORTE
  13.     bcf TRISE, RE7 ; porte re7 wyjscie
  14.  
  15. on_off: btfsc PORTB, RB0
  16.        goto on_off
  17.        negf PORTE, RE7
  18.  
  19. wait_for_release:  
  20.       btfss PORTB, RB0
  21.       goto wait_for_release
  22.       goto on_off
  23.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement