Pages: [1]   Go Down
Author Topic: battery symbol for 20x4 hitachi lcd  (Read 843 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 39
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone,
  Has anyone made a small battery symbol using one character space, it would be awesome someone could show me what to do smiley-lol

   Cheers, Neo
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 39
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a call of overloaded 'write(int)' is ambiguous

Code:
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

byte battery[8] = {
  B01110,
  B10001,
  B11001,
  B10101,
  B10011,
  B10001,
  B11111,
};

void setup() {
  lcd.createChar(0, battery);
  lcd.begin(16, 2); 
  lcd.write(0);
}

void loop() {}

« Last Edit: February 23, 2012, 09:19:28 pm by overclock » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 39
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

what am i doing wrong?


ok so i found the fix, the example has not been updated to 1.0

the line where you print the character needs to read
Code:
lcd.print((char)0);
Not
lcd.write(0);

that will solve the problem
« Last Edit: February 23, 2012, 10:07:34 pm by overclock » Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 74
Posts: 7236
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Refer to bullet point 1 for reason of the write problem:

http://liudr.wordpress.com/2011/12/26/how-to-update-codes-and-libraries-for-arduino-1-0/

Caught me with LCD custom characters too and I dug deep into the library codes to summarize the problem into one bullet point  smiley-lol
Logged


Pages: [1]   Go Up
Jump to: