Skip to content

Oops! I’m late.

September 21, 2010

I was supposed to announce my new programming idea Saturday. I forgot. But here it is:

Grayscale can be achieved on the NXT’s screen; this has been done with alternate programming languages such as NXC and Bricxcc. Why? Because these run much faster. But I wanted a challenge: I wanted to see if it could be done simply with NXT-G.

It turns out, you can! But just a little bit. The NXT’s display refreshes at 10 hz: in other words, it refreshes 10 times per second. However, there is nothing in NXT-G to synchronize display blocks. So, if you tell it to constantly loop 10 display blocks, each with a different image, it will flicker. Badly. Unless, of course, you get lucky, and the screen refreshes every time the loop starts over. If that happens, you get a perfect, ’10-color’ grayscale image. But it doesn’t happen very often, apparently. Now, if you drop down to 4 or 5 images, flickering is much less likely. Of course, you only get 4 or 5 ‘colors’, respectively. (‘Color(s)’ here refers to the shade(s) of black, and does not include white.)

So can grayscale be achieved? The answer is yes.  While faster programming languages  can run faster, and thus display a few more frames per second, NXT can indeed a lower-quality form of grayscale.

Advertisements

From → Uncategorized

3 Comments
  1. Actually, the refresh rate is not 10 hz. The screen refreshes every 17 milliseconds. If it were to be 10 hz then the screen would refresh every 100 milliseconds. It says it takes 17 milliseconds in the NXC Programmers book by John Hansen. Also I know because I make grayscale NXT games and it waits 17 ms before drawing the screen again.

    • I think that’s referring to the software. AFAIK, the hardware in the NXT is quite modular, and the screen itself has limitations greater than the module driving it. IOW, the software might send a new frame to the screen every 17 ms, but the screen has to buffer the image and can only draw a new one every 100 ms.

Trackbacks & Pingbacks

  1. Most Recent “Requested Topic” is…. | Stryker's NXT Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: