[NXC] Check if pixel is on/off?

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
nxtboyiii
Posts: 366
Joined: 02 Oct 2010, 07:08
Location: Everywhere

Re: [NXC] Check if pixel is on/off?

Post by nxtboyiii »

Pointless?? Maybe so. I just need to squeeze all the speed out of it.
Thanks, and have a nice day,
nxtboy III

programnxt.com
spillerrec
Posts: 358
Joined: 01 Oct 2010, 06:37
Location: Denmark
Contact:

Re: [NXC] Check if pixel is on/off?

Post by spillerrec »

nxtboyiii wrote:Pointless?? Maybe so. I just need to squeeze all the speed out of it.
That is pointless. While the function isn't going to become faster, notice that it is inefficient. It cannot retrieve a single pixel, it has to retrieve a whole bunch of them and trow the others away.
So if you want your code to go faster, try to modify your code so that it accesses the pixels in a way so that you can integrate isPixelSet() into your function and reduce the amount of pixels wasted.
My blog: http://spillerrec.dk/category/lego/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
Post Reply

Who is online

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