To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.nxtOpen lugnet.robotics.nxt in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / NXT / 983
982  |  984
Subject: 
Re: Displaying multiple variables
Newsgroups: 
lugnet.robotics.nxt
Date: 
Sat, 17 Nov 2007 20:36:12 GMT
Viewed: 
28602 times
  
In lugnet.robotics.nxt, Edwin Pilobello wrote:

How can we do this more elegantly?  Perhaps even
adding a description and show on two lines?

There are lots of ways to display such information on the NXT LCD. The easiest
is probably to draw one number, and then use a second Display block to draw a
second number - just uncheck the "clear screen" checkbox on the second Display
block.

As to doing it more elegantly, I ended up making a My Block that will accept a
number, a line, and a label (text string - you need v1.1 to do this part), and
draw it on the screen, even clearing the spaces after the value you print and
giving you the option of either clearing the screen or not clearing the screen.
And the whole thing is about five blocks long. If you want to use it as an
example, I recently put it up on NXTlog along with a simple math program that
uses a number of these "helpful My Blocks":

http://mindstorms.lego.com/nxtlog/projectlist.aspx?SearchText=hailstone

(right now that will list both part one and part two - there's a number of handy
My Blocks in there, and the program itself, dealing with Hailstone numbers, is
kind of fun.. well, OK, it's fun if you happen to be me or some other math
geek).

Of course this probably means doing a concatenation...

True - but that's just a single block. And line feeds don't actually work in
NXT-G (at least as far as I can tell)

--
Brian Davis



Message has 2 Replies:
  Re: Displaying multiple variables
 
(...) Nice. Thanks very much. When I get to my computer, I'm going to check to see how I missed the "Clear Screen" checkbox. (17 years ago, 17-Nov-07, to lugnet.robotics.nxt)
  Re: Displaying multiple variables
 
(...) There's also Steve Hassenplug's Display Number block (find it here (URL) along with some other NXT-G goodies). I use this all the time to display values for debugging. John (17 years ago, 19-Nov-07, to lugnet.robotics.nxt)

Message is in Reply To:
  Displaying multiple variables
 
Yesterday, I had a student who wished to display two numeric variables on the screen. We ended up multiplying the first by 1000 then adding the second. This we displayed and read as a packed variable with two shifted values. How can we do this more (...) (17 years ago, 17-Nov-07, to lugnet.robotics.nxt)

4 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR