diff options
author | Matt Strapp <msattr@gmail.com> | 2020-02-28 11:20:34 -0600 |
---|---|---|
committer | Matt Strapp <msattr@gmail.com> | 2020-02-28 11:20:34 -0600 |
commit | 9416d720e118e4b5508ad17d64af0c9b69ff3a2f (patch) | |
tree | 8377222e117bcf97829713cce37c6525a2e50222 /Lab3.X/display.c | |
parent | Merge origin/master (diff) | |
download | ee2361-9416d720e118e4b5508ad17d64af0c9b69ff3a2f.tar ee2361-9416d720e118e4b5508ad17d64af0c9b69ff3a2f.tar.gz ee2361-9416d720e118e4b5508ad17d64af0c9b69ff3a2f.tar.bz2 ee2361-9416d720e118e4b5508ad17d64af0c9b69ff3a2f.tar.lz ee2361-9416d720e118e4b5508ad17d64af0c9b69ff3a2f.tar.xz ee2361-9416d720e118e4b5508ad17d64af0c9b69ff3a2f.tar.zst ee2361-9416d720e118e4b5508ad17d64af0c9b69ff3a2f.zip |
Redo numpad
Diffstat (limited to '')
-rw-r--r-- | Lab3.X/display.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Lab3.X/display.c b/Lab3.X/display.c index 5ad9c4f..d456b49 100644 --- a/Lab3.X/display.c +++ b/Lab3.X/display.c @@ -2,9 +2,13 @@ #include "display.h"
//Functions used for Display
-void init7seg(void) {
- TRISB = 0b0000000000000011; //and port B to outputs
- LATB = 0x0000; //and all of port B to LOW
+void init7seg(void) {
+ CLKDIVbits.RCDIV = 0; //Set RCDIV=1:1 (default 2:1) 32MHz or FCY/2=16M
+ AD1PCFG = 0x9fff; //sets all pins to digital I/O
+ TRISA = 0b0000000000011111; //set port A to inputs,
+ TRISB = 0b0000000000000011; //and port B to outputs
+ LATA = 0x0000; //Set all of port A to LOW
+ LATB = 0x0000; //and all of port B to LOW
}
void showChar7seg(char myChar, enum DIGIT myDigit) {
@@ -61,6 +65,6 @@ void showChar7seg(char myChar, enum DIGIT myDigit) { default:
LATB ^= (0b11111111 << 2);
break;
- } //END OF SWITCH
+ } //END OF SWITCH
LATB |= myDigit;
}
\ No newline at end of file |