Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.95 KB | None | 0 0
  1. #include "io430.h"
  2. #include "diody.h"
  3.  
  4. void initLED()
  5. {
  6.     P1DIR |= BIT5;      //Inicjowanie diody REL1
  7.     P1DIR |= BIT6;      //Inicjowanie diody REL2
  8.     P2DIR |= BIT1;      //Inicjowanie dioty STATUS
  9. }
  10.  
  11. void onSTATUS()
  12. {
  13.     P2OUT &=~BIT1;      //Włączenie diody STATUS
  14. }
  15.  
  16. void onREL1()
  17. {
  18.     P1OUT |= BIT5;      //Włączenie diody REL1
  19. }
  20.  
  21. void onREL2()
  22. {
  23.     P1OUT |= BIT6;      //Włączenie diody REL2
  24. }
  25.  
  26. void offSTATUS()
  27. {
  28.     P2OUT |= BIT1;      //Wyłączenie diody STATUS
  29. }
  30.  
  31. void offREL1()
  32. {
  33.     P1OUT &= ~BIT5;     //Wyłączenie diody REL1
  34. }
  35.  
  36. void offREL2()
  37. {
  38.     P1OUT &= ~BIT6;     //Wyłączenie diody REL2
  39. }
  40.  
  41. void setOppositeSTATUS()
  42. {
  43.     P2OUT ^= BIT1;      //Ustawienie przeciwnego stanu diody STATUS
  44. }
  45.  
  46. void setOppositeREL1()
  47. {
  48.     P1OUT ^= BIT5;      //Ustawienie przeciwnego stanu diody REL1
  49. }
  50.  
  51. void setOppositeREL2()
  52. {
  53.     P1OUT ^= BIT6;      //Ustawienie przeciwnego stanu diody REL2
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement