Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char IfPinLow (const uint16_t MYPORT, const uint8_t MYPIN )
- {
- uint8_t lowcount = 0;
- for(uint8_t y=0; y<2; y++)
- {
- for(uint8_t i=0; i<51; i++)
- {
- if((MYPORT & MYPIN) == 0) lowcount++;
- _delay_ms(1);
- }
- }
- if(lowcount >= 75) return 1;
- return 0;
- }
- char IfPinHigh (const uint16_t MYPORT, const uint8_t MYPIN )
- {
- uint8_t highcount = 0;
- for(uint8_t y=0; y<2; y++)
- {
- for(uint8_t i=0; i<51; i++)
- {
- if(MYPORT & MYPIN) highcount++;
- _delay_ms(1);
- }
- }
- if(highcount >= 75) return 1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement