View unanswered posts | View active topics It is currently Mon Sep 21, 2020 12:14 pm

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

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

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:
-> Blue

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).


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

Joined: Wed Jan 24, 2007 10:42 am
Posts: 620
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:

 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

Mon Feb 25, 2008 4:20 pm
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.