Display Time Block Bug

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
bungeshea
Posts: 207
Joined: 14 Aug 2011, 08:45
Location: Australia
Contact:

Re: Display Time Block Bug

Post by bungeshea »

I can't wire a number greater then 32999 in to the Display Time or Display Number block without it stuffing up.
PS I used the Windows Version of NeXT Screen straight from the BricxCC Website, but yes the NeXT Screen BricxCC does have a "Capture AVI" feature.
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: Display Time Block Bug

Post by muntoo »

Let me guess: the range is -32768 to 32767?

A 16-bit signed integer has that range.
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
hassenplug
Posts: 346
Joined: 27 Sep 2010, 03:05
Contact:

Re: Display Time Block Bug

Post by hassenplug »

mattallen37 wrote:It does that because the value is a 16-bit signed value. Because time can't be negative, the block should use either an unsigned 16-bit variable (up to ~65,000), or an unsigned 32-bit variable (up to >4,000,000,000).
Yes, Matt hit it on the head. A signed int is used in the calculation. It should be reduced from a ms value to seconds, or tenths of seconds, and then displayed.

I really should fix that.

Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
bungeshea
Posts: 207
Joined: 14 Aug 2011, 08:45
Location: Australia
Contact:

Re: Display Time Block Bug

Post by bungeshea »

Oh now I get it...
I borrowed out the book 'LEGO MINDSTORMS for Dummies' from the library, (even tough it only dealt with the old MINDSTORMS, and I only have an NXT 2.0) and while I was reading it I came across this footnote.
IMAG0259.jpg
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 10 guests