![](/media/cache/profiles/851fd85e0c2baf63f6042123c2b4aac7.50x50_q85.jpg)
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.
Revision 1:a9641f372bea, committed 2013-04-17
- Comitter:
- RorschachUK
- Date:
- Wed Apr 17 18:14:12 2013 +0000
- Parent:
- 0:a954bd7fd162
- Commit message:
- Added a preview rectangle and corrected a calculation.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r a954bd7fd162 -r a9641f372bea main.cpp --- 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