Projekt/snake_init.c
void init_buttons_switches(){
  volatile uint16_t* port_d_pointer = TRISD; //TRISD
  uint16_t mask = 0b1111100000001111; //<=> 0xf80f
  *port_d_pointer = *port_d_pointer | 0b1111100000001111; // 0bXXXXX0000000XXXX <=> ta bort de bitarna vi vill ändra
  *port_d_pointer += 0b0000011111110000; //add 1 to where we want 1:s - set input
  
}
//sets the Buttons and Switches on port D to output - 1 marks output
sets the Buttons and Switches on port D to output - 1 marks output
sets the Buttons and Switches on port D to output - 1 marks output
void init_buttons_switches(){
  volatile uint16_t* port_d_pointer = TRISD; 
  uint16_t mask = 0b1111100000001111; 
  *port_d_pointer = *port_d_pointer | 0b1111100000001111; 
  *port_d_pointer += 0b0000011111110000; 
}
void init_buttons_switches ( ) { volatile uint16_t * port_d_pointer = TRISD ; uint16_t mask = 0b1111100000001111 ; * port_d_pointer = * port_d_pointer | 0b1111100000001111 ; * port_d_pointer += 0b0000011111110000 ; }
sets the Buttons and Switches on port D to output - 1 marks output
sets the Buttons and Switches on port D to output - 1 marks output
//TRISD //<=> 0xf80f // 0bXXXXX0000000XXXX <=> ta bort de bitarna vi vill ändra //add 1 to where we want 1:s - set input