Firstly, hope the thread title is not misleading (it probably is) but not sure how to title this question. I'm positioning a cursor on an LCD screen. Works ok, done it loads of times in previous programs. But trying to make the code a little 'neater / tighter'. This is what I have been doing thus far...
At the top of your c file (or in a header file included in any c file from which you call the function putcsr) add the following line:
Code:
void putcsr (char pos);
Also, consider what putcsr(0x8f) looks like. I can guess that you're putting the cursor somewhere, but I don't know where it is going. Will you know where it is going a year from now or will you have to look at the display datasheet? Consider using a #define
I agree entirely.. but write2LCD() might be at the lowest level and stack could be an issue! ( Yes!! I know in this case it won't, but caution needed, I don't know the ram size)