Skip to main content
2 of 3
added 2 characters in body
Handoko
  • 445
  • 2
  • 11

First of all you need to configure your input and output correctly.

You used TRISA = 1; which means only RA0 is an INPUT. Please change this to "TRISA = 0b00000111;" or "TRISA = 0x07; to configure all 3 buttons as INPUT.

Same counts for TRISB. Change this value to 0x00000111 or 0x07.

As Peter has mentioned change all your cases on the switch to:

case1: // TODO return; case2: // TODO return;

Besides, I don't even see where you scripted what the MCU has to do when a button is pressed?

Handoko
  • 445
  • 2
  • 11