Page 1 of 3
NXT Grayscale Screen?
Posted: 25 Feb 2011, 23:12
by nxtboyiii
Hi,
Does anyone know how to make the nxt screen look grayscale?
Like for a splash screen for a game?
Could someone make a sample program of greyscale?
Thanks, and have a nice day,
nxtboy III
Re: NXT Grayscale Screen?
Posted: 25 Feb 2011, 23:22
by timpattinson
hi, The NXT screen is black and white... no grayscale unless you flash a pixel on and off many times a second... But the refresh rate for the screen is 10hz (10 times a second so that probably wouldn't look so good) (It would flicker)
In NXC you can change the contrast of the whole screen, but not individual pixels
-Tim
Re: NXT Grayscale Screen?
Posted: 26 Feb 2011, 00:14
by muntoo
timpattinson wrote:hi, The NXT screen is black and white... no grayscale unless you flash a pixel on and off many times a second... But the refresh rate for the screen is 10hz (10 times a second so that probably wouldn't look so good) (It would flicker)
In NXC you can change the contrast of the whole screen, but not individual pixels
-Tim
Theoretically, it would require 24Hz * for a "smooth" blend, and a higher frequency if you want different shades of gray with the same "smoothness".
* 24Hz == 2 * 12Hz.
12Hz is sort of your eyes' capture rate.
Re: NXT Grayscale Screen?
Posted: 26 Feb 2011, 02:15
by nxtboyiii
I already know that you can only choose black or white, but I need a program for it that still looks ok. Like an actual picrure of something that "looks" gray.
The TI-84 calculator has only black and white, yet many grayscale pictures have been made using a flickering method.
Re: NXT Grayscale Screen?
Posted: 26 Feb 2011, 02:29
by muntoo
nxtboyiii wrote:The TI-84 calculator has only black and white, yet many grayscale pictures have been made using a flickering method.
That's probably because the hardware supports such high flickering speeds.
-----
Try this:
Code: Select all
#define TIME_BEFORE_INCREASE 100
#define INCREASE_BY 1
task main()
{
for(unsigned long waitTime = 0; 1; waitTime += INCREASE_BY)
{
for(unsigned long timer = CurrentTick(); (timer + TIME_BEFORE_INCREASE) > CurrentTick(); )
{
ClearScreen();
RectOut(0, 0, 8, 8, DRAW_OPT_FILL_SHAPE);
}
}
}
Re: NXT Grayscale Screen?
Posted: 26 Feb 2011, 06:42
by mightor
The NXT's screen is limited by hardware to about a 10Hz refresh rate. So flicker all you want, you won't see anything but a horrible shearing effect. If this is what you're after then by all means
- Xander
Re: NXT Grayscale Screen?
Posted: 26 Feb 2011, 07:09
by mattallen37
I was just wondering the other day, if it is possible to speed up the refresh rate (for those who want to have grayscale). I think Nicolas increased the motor control update rate from 10Hz to 100Hz, so I wonder if the screen could also be updated that often (or if it already is, when using his FW). Is it totally a hardware set speed? I wouldn't assume so, 10Hz max speed based on hardware seems incredibly slow, for almost anything that is just handling signals. I would assume it is a software limitation (Firmware), and that is why I wonder if it could be increased (or already has been, by Nicolas). Just an idea I had the other day.
Re: NXT Grayscale Screen?
Posted: 26 Feb 2011, 07:14
by mightor
It's the controller for the screen that's the limiting factor, not the firmware.
- Xander
Re: NXT Grayscale Screen?
Posted: 26 Feb 2011, 07:22
by mattallen37
Ok, I just thought that maybe the ARM just only updates the ATMEGA48 I2C registers 10 times a second. Nicolas somehow got the motor control update speed up to, I think 100Hz, and isn't the ATMEGA what controls the motors? I just wondered if the screen update speed was the same issue, and could be increased by faster/more frequent I2C updates.
Edit: So, you are saying that it is the ATMEGA48 that has the limit of 10Hz, and I was curious to know if perhaps 10Hz was the speed that the ARM updated the ATMEGA.
Re: NXT Grayscale Screen?
Posted: 26 Feb 2011, 07:32
by mightor
No, the screen is not controlled by by the Atmega, it's connected to the ARM with SPI. Take a look below, this is from the schematics PDF from the HDK.
Hope that clarifies it.
- Xander