scrolling text on 635


New member
I took the day off work because I got my 635 and suddenly felt too sick to go in. I used the "Ultra simple example" from Crystalfontz and edited it a bit and made this program that Ill attach. You can use it to make line scroll horizontally on the 635. Like if a string of text is longer than 20 characters.
Just open the test635.c and edit the "type text string in here" then make and run the program.
Right now is checks for key presses after each refresh... but it doesnt seem to work very well, so if someone can show me how to do a multi thread... fork()? I guess?? I dont know... something better than what it is.

Oh, I almost forgot.... remove the .zip extension from the tar file
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.



New member
I'm busy writing a Linux app myself to drive my CF-635 display. How I've handled it myself is by having the main + 2 additional threads.

Basically the main thread does the setup and init of two other threads. One thread is purely for receiving packets from the display and dispatching them to the rest of the app (and plugins). The other is a big while loop which dequeues "events" that relate to screen update events (such as text scroll, LED updating, screen changing etc.). Synchronisation is provided by a specially-coded priority queue where an item is only dequeued after a specific amount of time. This lets me (for example) have text scroll by 1 character every 250ms, while having an LED flash at 1Hz and still respond to keypresses immediately (by queueing the keypress event notification with a dequeue time of zero).

As for programming advice, start with the man pages for pthread_create and pthread_join to get basic threads working. Use pthread_cond_init, pthread_cond_wait and pthread_cond_signal to communicate between threads. Use pthread_mutex_init and pthread_mutex_lock to safely manage shared data.

I would share the source on this forum, but at present it's a mess and I work for a big software company: need to check for IP issues (welcome to the corporate world). :) Hopefully this won't be too far away.



New member
awesome... im looking over all this stuff now. If you get to a place where you can post an example i would like to see it