• We recently switched our forum platform. If you experience any issues please email support@crystalfontz.com

Arduino Mega 2560 and CF634 serial

mm00re

New member
I am currently working to get a 634 display to work with my arduino Mega 2560 for my project.

I have the JPB closed to invert the signal and it will display text typed into the serial monitor. I am however having trouble getting it to accept control signals.

Whenever I type in a \026 or for that matter anything with the "\" first, the display shows the Yen symbol ¥ so my display shows ¥026

Is there some other method that I need to use?

Thanks!
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

CF Tech

Administrator
The "\026" is just a notation used in the data sheet and WinTest for sending a "binary" byte (as opposed to ASCII characters) with a value of 26.

For the Arduino, I think the syntax would be:

Serial.write(26);
 

mm00re

New member
The "\026" is just a notation used in the data sheet and WinTest for sending a "binary" byte (as opposed to ASCII characters) with a value of 26.

For the Arduino, I think the syntax would be:

Serial.write(26);

Your suggestion did work. I have one other question for you if you would be so kind.

If I need to send multiple values for say adjusting brightness, contrast, or even at a certain point on the lcd.

Do I need to send the commands on the same line?

Something like Serial.write(17,10,1); won't work. Is there a different way of doing this?

Thanks in advance!
 

CF Tech

Administrator
Something like Serial.write(17,10,1); won't work.
The interface is not time dependent, so just do:

Serial.write(17);
Serial.write(10);
Serial.write(1);

Or you could write a function that takes a pointer to a binary string and loops through it.
 

mm00re

New member
As it turns out it looks like the best way to write this is by the following:

Serial.write((byte)17);
Serial.write((byte)0);
Serial.write((byte)0);
doing it the way you suggested works most of the time, that is until you need to go and put your cursor at row 0 or column 0, by declaring Serial.write(0); or Serial.write(); will generate a compile error but I managed to get the question answered on an Arduino forum however you pointed me in the right direction and I thank you very much for your help! :)
 
Top