aboutsummaryrefslogtreecommitdiffstats
path: root/Lab3.X/numpad.c
diff options
context:
space:
mode:
Diffstat (limited to 'Lab3.X/numpad.c')
-rw-r--r--Lab3.X/numpad.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lab3.X/numpad.c b/Lab3.X/numpad.c
new file mode 100644
index 0000000..fcd87cc
--- /dev/null
+++ b/Lab3.X/numpad.c
@@ -0,0 +1,9 @@
+#include "xc.h"
+void initKeyPad(void) {
+ TRISA = 0b0000000000011111; //set port A to inputs,
+ LATA = 0x0000; //Set all of port A to LOW
+ CNPU1bits.CN11PUE = 1;
+ CNPU1bits.CN12PUE = 1;
+ CNPU1bits.CN13PUE = 1;
+ CNPU1bits.CN14PUE = 1;
+}