Kamil Ondrousek / Mbed 2 deprecated Chaotic

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 = 3.7;
00008 
00009     float x = 0.1;
00010     float y = 0;
00011 
00012     int xout = 0;
00013     int yout = 0;
00014  
00015  while (1) {
00016  
00017     double oldX = x;
00018   
00019     x = a*oldX*(1-oldX);
00020     y++;
00021     
00022     if (y>=640){
00023     
00024     y = 0;
00025     lcd.cls();
00026     
00027     }
00028   
00029     xout = -80+(x*340);
00030     yout = (y/2);
00031    
00032     lcd.pixel(xout,yout,WHITE);
00033   
00034 }
00035 }