how to draw a Boolean value on the LCD screen?

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

how to draw a Boolean value on the LCD screen?

Postby treeface99 » Tue Jan 10, 2012 11:20 pm

Hi

Throughout my code i have been drawing ints and strings on the lcd display like the following:

LCD.drawInt(Number, 1, 6);
LCD.drawString("Hello", 1, 2);

but i cant for the life of me work out how to draw a boolean value. My boolean value is called decision. I have tried using Char with no luck.

LCD.drawChar(decision, 1, 2);

Any Ideas?

Many Thanks
treeface99
Novice
 
Posts: 30
Joined: Thu Nov 24, 2011 10:07 am

Re: how to draw a Boolean value on the LCD screen?

Postby kirkpthompson » Tue Jan 10, 2012 11:28 pm

Try
Code: Select all
LCD.drawString("" + decision, 1, 2);

and report back the results.

Best,
-K
Leg Godt!
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Re: how to draw a Boolean value on the LCD screen?

Postby treeface99 » Wed Jan 11, 2012 10:53 am

Great, thanks very much!
treeface99
Novice
 
Posts: 30
Joined: Thu Nov 24, 2011 10:07 am

Re: how to draw a Boolean value on the LCD screen?

Postby skoehler » Wed Jan 11, 2012 10:55 am

kirkpthompson wrote:Try
Code: Select all
LCD.drawString("" + decision, 1, 2);


Or even more straightforward (i.e. without the using the string addition trick):
Code: Select all
LCD.drawString(String.valueOf(decision), 1, 2);
skoehler
leJOS Team Member
 
Posts: 1421
Joined: Thu Oct 30, 2008 4:54 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 4 guests

more stuff