aboutsummaryrefslogtreecommitdiffstats
path: root/Lab5.X/lab5_lcd.c
diff options
context:
space:
mode:
authorRossTheRoss <msattr@gmail.com>2020-04-24 13:16:17 -0500
committerRossTheRoss <msattr@gmail.com>2020-04-24 13:16:17 -0500
commite9f3d4a56d10de933c9c22646a7b084ec3cff20f (patch)
treed1482ec0ae76500e2df3fa6cda276722a1aaa167 /Lab5.X/lab5_lcd.c
parentForget to add a bunch of things (diff)
downloadee2361-e9f3d4a56d10de933c9c22646a7b084ec3cff20f.tar
ee2361-e9f3d4a56d10de933c9c22646a7b084ec3cff20f.tar.gz
ee2361-e9f3d4a56d10de933c9c22646a7b084ec3cff20f.tar.bz2
ee2361-e9f3d4a56d10de933c9c22646a7b084ec3cff20f.tar.lz
ee2361-e9f3d4a56d10de933c9c22646a7b084ec3cff20f.tar.xz
ee2361-e9f3d4a56d10de933c9c22646a7b084ec3cff20f.tar.zst
ee2361-e9f3d4a56d10de933c9c22646a7b084ec3cff20f.zip
Add MORE stuff I forget to commit
Diffstat (limited to '')
-rw-r--r--Lab5.X/lab5_lcd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lab5.X/lab5_lcd.c b/Lab5.X/lab5_lcd.c
index 8c0af52..f9567ad 100644
--- a/Lab5.X/lab5_lcd.c
+++ b/Lab5.X/lab5_lcd.c
@@ -1,7 +1,9 @@
#include "xc.h"
#include "lab5_lcd.h"
#include "string.h"
-#define CON 32
+//CON should be between 0 and 0xFF.
+#define CON 0x00
+
//Obligatory delay function
void delay(long n){
for (n=n; n>0; n--) {
@@ -31,7 +33,7 @@ void lcd_init(void) {
lcd_cmd(0b00111000); // function set, normal instruction mode
lcd_cmd(0b00111001); // function set, extended instruction mode
lcd_cmd(0b00010100); // interval osc
- lcd_cmd(0b01110000); // contrast C3-C0
+ lcd_cmd((0b0111 << 4) + CON); // contrast C3-C0
lcd_cmd(0b01011110); // Ion, Bon, C5-C4
lcd_cmd(0b01101100); // follower control
delay(266665);