3-cells CNN chaotic system for arduino with gameduino shield.
--------------------------------------------------------------------------------------------------------------
#include "SPI.h"
#include "GD.h"
byte i;
float p1 = 1.24;
float p2 = 1.1;
float r = 4.4;
float s = 3.21;
float h1 = 0;
float h2 = 0;
float h3 = 0;
float x = 0.1;
float y = 0.1;
float z = 0.1;
float xn = x;
float yn = y;
float zn = z;
float dt = 0.01;
void setup()
{
GD.begin();
GD.ascii();
GD.wr16(RAM_SPRPAL + (0 * 2), 0x8000);
GD.wr16(RAM_SPRPAL + (1 * 2), RGB(255, 255, 255));
GD.fill(RAM_SPRIMG, 0, 256);
GD.wr(RAM_SPRIMG + 0x78, 1);
GD.putstr(12, 1, "3-Cells CNN chaotic system");
}
void loop()
{
h1 = 0.5*(abs(x+1)-abs(x-1));
h2 = 0.5*(abs(y+1)-abs(y-1));
h3 = 0.5*(abs(z+1)-abs(z-1));
xn = -x+p1*h1-s*h2-s*h3;
yn = -y-s*h1+p2*h2-r*h3;
zn = -z-s*h1+r*h2+h3;
x = x+xn*dt;
y = y+yn*dt;
z = z+zn*dt;
GD.sprite(i++, 200+(105*x), 150+(95*y), 0, 0, 0);
}
--------------------------------------------------------------------------------------------------------------







