Anonymous avatar Anonymous committed 93fa478

First attempt to make it compatible to Romans circuit

Comments (0)

Files changed (2)

LiquidCrystal_SR1.cpp

 	// Divide byte in two nibbles (val1 and val2), include the RS signal
 	// and format it for shiftregister output wiring to the LCD
 	mode = mode ? SR_RS_BIT : 0; // RS bit; LOW: command.  HIGH: character.
-	val1 = mode | SR_EN_BIT | ((value >> 1) & 0x78); // upper nibble
-	val2 = mode | SR_EN_BIT | ((value << 3) & 0x78); // lower nibble
+	val1 = mode | SR_EN_BIT | (value & 0xF0); // upper nibble
+	val2 = mode | SR_EN_BIT | ((value << 4) & 0xF0); // lower nibble
 
 	// unused outputs to high (faster)
-	val1 |= SR_UNUSED_BITS;
-	val2 |= SR_UNUSED_BITS;
+	//val1 |= SR_UNUSED_BITS;
+	//val2 |= SR_UNUSED_BITS;
 
 //	val1 |= SR_EN_BIT; // Enable high
 	fio_shiftOut1(_srSignalRegister,_srSignalBit,val1);

LiquidCrystal_SR1.h

 
 // two-wire indicator constant
 // ---------------------------------------------------------------------------
-#define SR_RS_BIT 0x04
-#define SR_EN_BIT 0x80
-#define SR_UNUSED_BITS 0x02
+#define SR_RS_BIT B00000100
+#define SR_EN_BIT B00001000
+#define SR_UNUSED_BITS B00000011
 
 class LiquidCrystal_SR1 : public LCD
 {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.