This is hopefully as arcane as this project's programming gets. I don't plan on making posts with hexadecimal values in them in future =)
I said I might post some Python code. I thought a simple example of the way I'm working with the display right now might be interesting. I have it connected to the mac via a USB/Serial adapter (0-3.3v TTL, not the usual voltages you get over your computer's connector, I had to order a different USB/Serial adapter for this).
That's loading the Python interpreter, setting the serial config values and opening the serial port.
Then I make a string 'v' that's 4 characters long, the format of which is represented by the four "B" (for byte, kinda) in the first argument. The next arguments are the values I want. The first is the 'set color' command, 0x84. Then two bytes each half describing the color I want. Then finally the clear screen command, 0x21.
s.write(v) sends that to the LCD and the screen turns red.
I said I might post some Python code. I thought a simple example of the way I'm working with the display right now might be interesting. I have it connected to the mac via a USB/Serial adapter (0-3.3v TTL, not the usual voltages you get over your computer's connector, I had to order a different USB/Serial adapter for this).
Code:
saint-wifi:ezlcd blake$ python
Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
>>> s = serial.Serial()
>>> s.baudrate = 115200
>>> s.port = "/dev/tty.SLAB_USBtoUART"
>>> s.parity = serial.PARITY_NONE
>>> s.stopbits = serial.STOPBITS_ONE
>>> s.bytesize = serial.EIGHTBITS
>>> s.open()
>>>
>>> from struct import pack
>>> v = pack("BBBB", 0x84, 0x00, 0xF0, 0x21)
>>>
>>> s.write(v)
>>>
That's loading the Python interpreter, setting the serial config values and opening the serial port.
Then I make a string 'v' that's 4 characters long, the format of which is represented by the four "B" (for byte, kinda) in the first argument. The next arguments are the values I want. The first is the 'set color' command, 0x84. Then two bytes each half describing the color I want. Then finally the clear screen command, 0x21.
s.write(v) sends that to the LCD and the screen turns red.