Mandelbrot viewer for SPI TFT touchscreen
Dependencies: SPI_TFT TFT_fonts Touch_tft mbed
A Mandelbrot viewer for Mikroelektronika's "TFT-Proto" 2.8" 320x240 TFT touch panel, which is a pretty inexpensive screen.
I used Peter Drescher's library for it - http://mbed.org/cookbook/SPI-driven-QVGA-TFT and also used his wiring diagram to make an adapter.
Diff: main.cpp
- Revision:
- 1:a9641f372bea
- Parent:
- 0:a954bd7fd162
--- a/main.cpp Sat Apr 13 19:27:43 2013 +0000 +++ b/main.cpp Wed Apr 17 18:14:12 2013 +0000 @@ -100,7 +100,8 @@ //Set new centre and zoom p = tt.to_pixel(p); centrex += (2.0 * p.x - WIDTH) / (zoom * WIDTH); - centrey += (2.0 * p.y - HEIGHT) / (zoom * HEIGHT); + centrey += (2.0 * p.y - HEIGHT) / (zoom * WIDTH); zoom *= 4.0; + tt.rect(p.x - WIDTH / 8.0, p.y - HEIGHT / 8.0, p.x + WIDTH / 8.0, p.y + HEIGHT / 8.0, Yellow); } } \ No newline at end of file