Society of Robots - Robot Forum

Software => Software => Topic started by: teoxan on March 12, 2010, 07:24:06 PM

Title: Axon 2 and Sparkfun's serial LCD
Post by: teoxan on March 12, 2010, 07:24:06 PM


Hi,

I have the serial LCD from Sparkfun ( the 20 x 4 model ).

Everything works fine, it displays output from a photoresistor I have plugged in, but I have two problems:

1) The backlight and the autoscroll is not working.

2) I get a warning when I compile my code : "Initialization from incompatible pointer type".

Here is the code


#include "sys/axon2.h"
#include "rprintf.h"
#include "serLCD"
#include "hardware.h"

Writer(serLCD_put_char);

SPARKFUN_SERLCD serLCD=MAKE_SPARKFUN_SERLCD_20_4(UART3,9600, &serLCD_put_char); **in this line I get the warning**

void appInitHardware(void )

.....
....
uartInit(OTHER_UART,OTHER_BAUD);

displayInit(&serLCD);

displayBrightness(&serLCD, 65);
displayContrast(&serLCD,80);
displayBacklight(&serLCD, TRUE);

rprintf(OTHER_ACTIVATE);
....


I have redirected the output to the LCD and it works ok, baud rate is ok and I get good readings.
But none of the backlight-contrast-brightness command works.

The LCD's backlight goes on when I open it and I also tested it on a Wiring microcontroller and the backlight works perfect.



I also noticed a serLCD.c code in the Displays\Sparkfun folder.
Any way I can use these commands?


Any ideas to help me?


thanks!

Theo

Title: Re: Axon 2 and Sparkfun's serial LCD
Post by: Webbot on March 13, 2010, 11:46:55 AM
Step 1 is to get rid of the warning.

Your code says:
#include "serLCD"

When it should be
#include "Displays/Sparkfun/serLCD.h"

Does that fix it? If not - then what msg do you get?
Title: Re: Axon 2 and Sparkfun's serial LCD
Post by: teoxan on March 13, 2010, 03:19:25 PM

I already have tried that, I have also written the full path, but no luck.

Also, I have noticed in one of the common header files for the displays, that all LCDs initialize with backlight off.

I changed that, by putting the boolean FALSE to TRUE in the header file, but still no luck.


Is it possible that the battery i have is not enough to cope with the backlight? ( my battery is a 6V 1250mAmp li-poly ).

Practically, I'm running out of solutions here..

What more to do???

Thanks

theo

Title: Re: Axon 2 and Sparkfun's serial LCD
Post by: Webbot on March 13, 2010, 05:22:23 PM
Quote
I already have tried that, I have also written the full path, but no luck.
What error messaging are you getting?

Quote
Also, I have noticed in one of the common header files for the displays, that all LCDs initialize with backlight off.

I changed that, by putting the boolean FALSE to TRUE in the header file, but still no luck.

Its actually done in a C file (which is compiled - and so makes no difference if you've changed it). So if you have changed a Header file then I wonder what you've changed instead.

I turn off the backlight by default to save on power.

The Sparkfun LCD doesn't support changing the contrast - so those commands will be ignored.


I turn on the backlight by sending the two bytes: 124 and 157
and turn it off by sending: 124 and 128

As per the datasheet.

You could always try sending 124 and 157 yourself to see if you can get it to work.

Title: Re: Axon 2 and Sparkfun's serial LCD
Post by: teoxan on March 14, 2010, 08:49:26 AM
Quote
What error messaging are you getting?

I don't get any error message, only the warning mentioned.

Quote
You could always try sending 124 and 157 yourself to see if you can get it to work.

I will re-load the Webbotlib files, because most probably I have messed something.

It's a good idea to try sending these bytes and see what happens.

Thanks for the help!!
Besides this problem the whole concept of the WebbotLib is very good!!

Thanks!

Theo