Commits

Thijs Alkemade committed 5d9720a

Added clear() and home(), removed some debug logging.

Comments (0)

Files changed (2)

+#! /usr/bin/python
+
+__all__ = ["hd44780"]
 	for i in range(8):
 		if (bits & (1 << i)) == 1 << i:
 			high(data_pins[i])
-			sys.stdout.write("1")
-		else:
-			sys.stdout.write("0")
 	pulse()
-	if char_mode:
-		print("01")
-	else:
-		print("00")
 	low(a[1])
 
 def write(string):
 		for c in string:
 				write8bits(ord(c), True)
 
+def clear():
+	write8bits(0x01)
+
+def home():
+	write8bits(0x02)
+
 def initialize():
 	bus.write_byte_data(address, 0x12, 0)
 	bus.write_byte_data(address, 0x13, 0)
 	write8bits(0x3b)
 	write8bits(0x08)
 	write8bits(0x01)
-	write8bits(0x0f)
+	write8bits(0x0c)
 	write8bits(0x06)