Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:5e722fb2f2bc
- Child:
- 1:2dcd2355ae5e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Dec 23 14:40:03 2010 +0000 @@ -0,0 +1,45 @@ +#include "TFT_4DGL.h" + +TFT_4DGL lcd(p9,p10,p11); + +int main() { + + float x = 0.5; + float y = 0.25; + float z = 0.125; + float oldx = 0; + float oldy = 0; + float oldz = 0; + + float dt = 0.02; + + 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; + + lcd.baudrate(600000); + + 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 = 160+(60*x); + yout = 120+3*(60*y); + + lcd.pixel(yout,xout,WHITE); + +} +} \ No newline at end of file