"\x24" is the fourth byte, "8" the fifth. With the I/O expander, you have only 8 bits. To write to the LCD controller, you have to first set the data bits and RS/RW bits to their desired values, and E to 1, and then you have set E to 0. (It is the falling edge of E that causes the controller to act on its inputs.) To write a byte, you have to write 4 bits, twice. (Except at the beginning, where you are in 8-bit mode.) To write a command byte with bits HGFEDCBA, you have to write HGFE0100, HGFE0000, DCBA0100, DCBA0000. To write a data byte with bits HGFEDCBA, you have to write HGFE0101, HGFE0001, DCBA0101, DCBA0001.
↧