View unanswered posts | View active topics It is currently Sat Apr 19, 2014 6:55 pm






Reply to topic  [ 2 posts ] 
Help: function nxtDisplayString 
Author Message
Rookie

Joined: Mon Feb 25, 2008 5:21 am
Posts: 2
Post Help: function nxtDisplayString
hello,

I'm using RobotC 1.05, with firmware 7.15.

Why cant the following code works?

int i = 0;
nxtDisplayString (i, "Some text");

I want to display an arrow on nxt screen when user navigate through a list of selection. Something like:

Choose color:
Red
-> Blue
Yellow

I want to exploit the function nxtDisplayString() on the fact that I only need to replace the first few characters (with blanks as the user move away from a selection, and '->' when user move to a selection).

Thanks.


Mon Feb 25, 2008 5:35 am
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 592
Post 
I recommend you upgrade to ROBOTC for Mindstorms 1.10, which is currently available on the website. This is a free upgrade and has greater string/display capabilities than 1.05 has.

Your code doesn't seem to work in 1.10 because it's expected a type "compileConst short" for the variable, whereas you declared a type "int".

This is a bug and I'll take a look at making the DisplayString take an int as well... but in the meantime you can try this:

Code:
 task main()
{
   compileConst short i = 0;
   nxtDisplayString(i, "Some text");
   wait1Msec(1000);  //so we can see the text on the screen
}

_________________
Timothy Friez
ROBOTC Developer - SW Engineer
tfriez@robotc.net


Mon Feb 25, 2008 4:20 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.