Kamil Ondrousek / Mbed 2 deprecated Henon
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 = 1.4;
00008     float b = 0.3;
00009 
00010     float x = 0.1;
00011     float y = 0;
00012 
00013     int xout = 0;
00014     int yout = 0;
00015  
00016  while (1) {
00017  
00018     double x1 = x;
00019     double y1 = y;
00020   
00021     x = y1+1-a*pow(x1,2);
00022     y = b*x1;
00023   
00024     xout = 120+(80*x);
00025     yout = 160+(360*y);
00026    
00027     lcd.pixel(xout,yout,WHITE);
00028   
00029 }
00030 }