Kamil Ondrousek
/
Gingerbreadman
Gingerbreadman fractal map
main.cpp@1:49e438c33468, 2010-12-26 (annotated)
- Committer:
- JLS
- Date:
- Sun Dec 26 20:22:22 2010 +0000
- Revision:
- 1:49e438c33468
- Parent:
- 0:eec1e0cd07a1
update
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JLS | 0:eec1e0cd07a1 | 1 | #include "TFT_4DGL.h" |
JLS | 0:eec1e0cd07a1 | 2 | |
JLS | 0:eec1e0cd07a1 | 3 | TFT_4DGL lcd(p9,p10,p11); |
JLS | 0:eec1e0cd07a1 | 4 | |
JLS | 0:eec1e0cd07a1 | 5 | int main() { |
JLS | 0:eec1e0cd07a1 | 6 | |
JLS | 0:eec1e0cd07a1 | 7 | float x = 0.5; |
JLS | 0:eec1e0cd07a1 | 8 | float y = 3.7; |
JLS | 0:eec1e0cd07a1 | 9 | |
JLS | 0:eec1e0cd07a1 | 10 | int xout = 0; |
JLS | 0:eec1e0cd07a1 | 11 | int yout = 0; |
JLS | 0:eec1e0cd07a1 | 12 | |
JLS | 0:eec1e0cd07a1 | 13 | while (1) { |
JLS | 0:eec1e0cd07a1 | 14 | |
JLS | 0:eec1e0cd07a1 | 15 | double oldX = x; |
JLS | 0:eec1e0cd07a1 | 16 | double oldY = y; |
JLS | 0:eec1e0cd07a1 | 17 | |
JLS | 0:eec1e0cd07a1 | 18 | x = 1+abs(oldX)-oldY; |
JLS | 0:eec1e0cd07a1 | 19 | y = oldX; |
JLS | 0:eec1e0cd07a1 | 20 | |
JLS | 0:eec1e0cd07a1 | 21 | xout = 90+(x*28); |
JLS | 0:eec1e0cd07a1 | 22 | yout = 70+(y*21); |
JLS | 0:eec1e0cd07a1 | 23 | |
JLS | 0:eec1e0cd07a1 | 24 | lcd.pixel(yout,xout,WHITE); |
JLS | 0:eec1e0cd07a1 | 25 | |
JLS | 0:eec1e0cd07a1 | 26 | } |
JLS | 0:eec1e0cd07a1 | 27 | } |