Re: NXT Grayscale Screen?
Posted: 26 Feb 2011, 07:51
Ah, you're right. Thanks for correcting me on that. I have no idea why I though the ATMEGA controlled it.
Give a child a robot, he'll play for an hour. Teach him to build, and he'll play forever.
https://mindboards.org:443/
Code: Select all
task main()
{
for (byte contrast = 0; contrast < DISPLAY_CONTRAST_MAX; contrast++)
{
SetDisplayContrast(contrast);
NumOut(0, LCD_LINE1, DisplayContrast(),);
Wait(100);
}
for (byte contrast = DISPLAY_CONTRAST_MAX; contrast > 0; contrast--)
{
SetDisplayContrast(contrast);
NumOut(0, LCD_LINE1, DisplayContrast());
Wait(100);
}
SetDisplayContrast(DISPLAY_CONTRAST_DEFAULT);
NumOut(0, LCD_LINE1, DisplayContrast());
while(true);
}
They want actual grayscale.timpattinson wrote:If all you want to do is change the color of the whole screen you can use SetDisplayContrast() in NXC (This requires EFW 1.28+)...
Hmm... can you change this at a frequency greater than 10Hz?timpattinson wrote:If all you want to do is change the color of the whole screen you can use SetDisplayContrast() in NXC (This requires EFW 1.28+)...
Code: Select all
void GS_RectOut(int x, int y, int width, int height, unsigned long options=DRAW_OPT_NORMAL, int blockSize = 2)
{
for(int _y = y; _y < (y + height + 1); _y++)
{
for(int _x = x; _x < (x + width + 1); _x++)
{
PointOut(_x, _y, ((_x % blockSize) + (_y % blockSize)) % blockSize);
}
}
}
Will test this ... stay tunedmuntoo wrote:Hmm... can you change this at a frequency greater than 10Hz?timpattinson wrote:If all you want to do is change the color of the whole screen you can use SetDisplayContrast() in NXC (This requires EFW 1.28+)...
Code: Select all
task main()
{
bool max = false;
unsigned long timer = CurrentTick();
for(int i = 0; i < INT_MAX; i++)
{
if(max)
{
SetDisplayContrast(DISPLAY_CONTRAST_DEFAULT);
}
else
{
SetDisplayContrast(DISPLAY_CONTRAST_MAX);
}
max = !max;
}
TextOut(0,LCD_LINE1,StrCat( NumToStr(CurrentTick() - timer),"ms" ,"/", NumToStr(INT_MAX)));
SetDisplayContrast(DISPLAY_CONTRAST_DEFAULT);
while(1);
}