Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "io430.h"
- #include "diody.h"
- void initLED()
- {
- P1DIR |= BIT5; //Inicjowanie diody REL1
- P1DIR |= BIT6; //Inicjowanie diody REL2
- P2DIR |= BIT1; //Inicjowanie dioty STATUS
- }
- void onSTATUS()
- {
- P2OUT &=~BIT1; //Włączenie diody STATUS
- }
- void onREL1()
- {
- P1OUT |= BIT5; //Włączenie diody REL1
- }
- void onREL2()
- {
- P1OUT |= BIT6; //Włączenie diody REL2
- }
- void offSTATUS()
- {
- P2OUT |= BIT1; //Wyłączenie diody STATUS
- }
- void offREL1()
- {
- P1OUT &= ~BIT5; //Wyłączenie diody REL1
- }
- void offREL2()
- {
- P1OUT &= ~BIT6; //Wyłączenie diody REL2
- }
- void setOppositeSTATUS()
- {
- P2OUT ^= BIT1; //Ustawienie przeciwnego stanu diody STATUS
- }
- void setOppositeREL1()
- {
- P1OUT ^= BIT5; //Ustawienie przeciwnego stanu diody REL1
- }
- void setOppositeREL2()
- {
- P1OUT ^= BIT6; //Ustawienie przeciwnego stanu diody REL2
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement