Computer Laboratory

ECAD and Architecture Practical Classes

Exercise 3* (Optional)

Behaviour

Produce a plot of the Mandelbrot Set on the tPad LCD, with the intensity of the surrounding points parameterised by the number of iterations for their disqualification from the set.

Implementation Advice

Assuming 8-bit variables for each RGB colour channel,

vid_set_pixel(x,y,((r<<16) | (g<<8) | b),display)

will set pixel (x,y) to have the RGB colour (r,g,b). Note that the LCD screen only supports 6-bit colour channels - the 2 LSBs of each value are trimmed.

One option is linear intensity variation, another is logarithmic. The endpoint colours may also be varied.

Previous  |  Contents  |  Next