Chua chaotic oscillator - 640x480 vga

Dependencies:   fastlib mbed vga640x480g

Files at this revision

API Documentation at this revision

Comitter:
JLS
Date:
Sun Feb 26 12:40:51 2012 +0000
Commit message:

Changed in this revision

fastlib.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
vga640x480g.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r f2258be4dcd9 fastlib.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fastlib.lib	Sun Feb 26 12:40:51 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Ivop/code/fastlib/#bc492a93e116
diff -r 000000000000 -r f2258be4dcd9 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Feb 26 12:40:51 2012 +0000
@@ -0,0 +1,52 @@
+#include "mbed.h"
+#include "vga640x480g.h"
+
+int main() {
+
+    init_vga();
+
+    vga_cls();
+
+    vga_box(0,0,639,479,WHITE);
+    
+    vga_putstring(10,10,"Chua chaotic oscillator",WHITE);
+    
+    float x = 0.5;
+    float y = 0.25;
+    float z = 0.125;
+    float oldx = 0;
+    float oldy = 0;
+    float oldz = 0;
+        
+    float dt = 0.005;
+    
+    float alpha = 15.6;
+    float beta = 28.58;
+    float a = -1.14286;
+    float b = -0.714286;
+    float h = 0;
+    
+    int xout = 0;
+    int yout = 0;
+ 
+ while (1) {
+ 
+    oldx = x;
+    oldy = y;
+    oldz = z;
+
+    h = (b * x) + (0.5 * (a - b) * (abs(x+1) - abs(x-1)));
+                
+    x = oldx + dt * (alpha * (oldy - oldx - h));
+    y = oldy + dt * (oldx - oldy + oldz);
+    z = oldz + dt * (-beta * oldy);
+    
+    xout = 320+(136*x);
+    yout = 240+(556*y); 
+
+    vga_plot(xout,yout,WHITE);
+    
+}
+
+  }    
+   
\ No newline at end of file
diff -r 000000000000 -r f2258be4dcd9 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Feb 26 12:40:51 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912
diff -r 000000000000 -r f2258be4dcd9 vga640x480g.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vga640x480g.lib	Sun Feb 26 12:40:51 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/gertk/code/vga640x480g/#821e34a87609