Go Down

Topic: Setting the cursor position for a Serial LCD (Read 1 time) previous topic - next topic

drone


Looks like your library supports 16x2 and 20x2, but doesn't not support 20x4 LCDs.



It is supposed to support 20x4, what's not working for you?

!c

JRMN

@DaveO, I bought the serial backpack because I need to free up some pins

@Drone, sorry for the late response, but my house was hit pretty hard by Irene.  As soon as I set my computer back up I will let you know the issues I experienced.  I have a lot on my mind right now and can't think clearly.

JRMN

You're right, it does work for 20x4 LCDs.

This didn't work:
Code: [Select]

#define LCD_WIDTH 20
SparkSoftLCD lcd = SparkSoftLCD(LCD_TX_PIN, LCD_WIDTH);


This worked:
Code: [Select]
SparkSoftLCD lcd = SparkSoftLCD(LCD_TX);

I did notice something weird though.  I am able to create and use custom characters with the SerLCD, however, if leave the Arduino Uno unplugged for awhile and then plug it back in, my sketch doesn't run correctly.  Right now I am only using custom characters.

drone



This didn't work:
Code: [Select]

#define LCD_WIDTH 20
SparkSoftLCD lcd = SparkSoftLCD(LCD_TX_PIN, LCD_WIDTH);


This worked:
Code: [Select]
SparkSoftLCD lcd = SparkSoftLCD(LCD_TX);

I did notice something weird though.  I am able to create and use custom characters with the SerLCD, however, if leave the Arduino Uno unplugged for awhile and then plug it back in, my sketch doesn't run correctly.  Right now I am only using custom characters.


That's odd that the constructor didn't work for you - I suppose it gave a compile error, about not having a matching prototype...  It may be resolved by saying:

Code: [Select]
SparkSoftLCD lcd = SparkSoftLCD(LCD_TX, (uint8_t) LCD_WIDTH);

Either way, it's not actuallly necessary since there is effectively no difference in how it drives the LCD with or without the width argument - that's likely an artifact from early on when it appeared the positioning arithmetic was different based on different widths.  It's not actually, and you can see in the cursorTo method it behaves the same given any width (I should remove the spurious inclusion of 'lenAdd').

Sorry to hear about the damage Irene did, haven't had to deal with a hurricane around here since Ike, and that was a pretty big clean-up.  Wouldn't wish that on anyone!

!c

Go Up