For the learning example in arduino website LiquidCrystal library > setCursor
As I understand the syntax of lcd.setCursor is lcd.setCursor(col, row)
I think the descriptions above the code :
lcd.setCursor(0, 0); // top left
lcd.setCursor(0, 15); // top right
lcd.setCursor(1, 0); // bottom left
lcd.setCursor(0, 15); // top right
should be
lcd.setCursor(0, 0); // top left
lcd.setCursor(15, 0); // top right
lcd.setCursor(0, 1); // bottom left
lcd.setCursor(15, 1); // top right
So the example code works fine( at least on my lcd module), but be aware that in lines 55 to 62 :
variable thisRow is actually referring to the column
variable thisCol is actually referring to the row
This is not the only place where the rows and columns have been interchanged. It appears that some of the Playground pages were edited incorrectly several months ago. A few days ago I sent a private message about this to the person who I believe made those changes but I have not received an answer back.
I don't have much C programming experience and I am afraid that if I try to fix things myself I might just make them worse. None the less I plan to start soon if I don't hear back.
I think the guy who's writing the LiquidCrystal library has done a good job, but learning examples just need to catch up a bit.
I tried the "HelloWorld" again, but it seems working fine. It is set :
lcd.begin ( 16, 2 ) for a 16 characters x 2 rows / lines display
In the funny world of lcd displays, the (0,0) is top left, which is quite different from conventional x,y co-ordinates in the math books. I think this is confusing sometimes.
In the funny world of lcd displays, the (0,0) is top left, which is quite different from conventional x,y co-ordinates in the math books. I think this is confusing sometimes.
There are alot of little things like this to get used to with microcontrollers ... such as counting starting at 0, I made many a mistake when first starting out.. always start counting at 1 and mess things up.
And I got an LCD that has 131x131 pixels... and it's the same way! Makes for a hassle when you're trying to remember exactly where that pixel would be on the screen.