Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdint.h>
- #include <pic32mx.h>
- #include "mipslab.h"
- int getsw( void )
- {
- int switchStatus;
- switchStatus = (PORTD >> 8) & 0x0f; //Extract bits 8 through 11
- return switchStatus;
- }
- int getbtns( void )
- {
- int btnStatus;
- btnStatus = (PORTD >> 5) & 0x07; //Extract bits 7, 5 and 6 (0111 = 0x7)
- return btnStatus;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement