Delayed Logistic map fractal

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "TFT_4DGL.h"
00002 
00003 TFT_4DGL lcd(p9,p10,p11);
00004 
00005 int main() {
00006    
00007     float a = 2.27;
00008 
00009     float x = 0.001;
00010     float y = 0.001;
00011 
00012     int xout = 0;
00013     int yout = 0;
00014  
00015  while (1) {
00016  
00017     double oldX = x;
00018     
00019     x = a*oldX*(1-y);
00020     y = oldX;
00021     
00022     xout = 35+(x*250);
00023     yout = 15+(y*205);
00024    
00025     lcd.pixel(yout,xout,WHITE);
00026   
00027 }
00028 }