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.
main.cpp@0:714ffbdde11c, 2010-12-25 (annotated)
- Committer:
- JLS
- Date:
- Sat Dec 25 14:28:44 2010 +0000
- Revision:
- 0:714ffbdde11c
- Child:
- 1:be9de147b3d1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JLS | 0:714ffbdde11c | 1 | #include "TFT_4DGL.h" |
JLS | 0:714ffbdde11c | 2 | |
JLS | 0:714ffbdde11c | 3 | TFT_4DGL lcd(p9,p10,p11); |
JLS | 0:714ffbdde11c | 4 | |
JLS | 0:714ffbdde11c | 5 | int main() { |
JLS | 0:714ffbdde11c | 6 | |
JLS | 0:714ffbdde11c | 7 | float a = 2.75; |
JLS | 0:714ffbdde11c | 8 | float b = 0.1; |
JLS | 0:714ffbdde11c | 9 | |
JLS | 0:714ffbdde11c | 10 | float x = 0; |
JLS | 0:714ffbdde11c | 11 | float y = 1; |
JLS | 0:714ffbdde11c | 12 | |
JLS | 0:714ffbdde11c | 13 | int xout = 0; |
JLS | 0:714ffbdde11c | 14 | int yout = 0; |
JLS | 0:714ffbdde11c | 15 | |
JLS | 0:714ffbdde11c | 16 | lcd.baudrate(600000); |
JLS | 0:714ffbdde11c | 17 | |
JLS | 0:714ffbdde11c | 18 | while (1) { |
JLS | 0:714ffbdde11c | 19 | |
JLS | 0:714ffbdde11c | 20 | double oldX = x; |
JLS | 0:714ffbdde11c | 21 | |
JLS | 0:714ffbdde11c | 22 | x = y; |
JLS | 0:714ffbdde11c | 23 | y = -b*oldX+a*y-pow(y,3); |
JLS | 0:714ffbdde11c | 24 | |
JLS | 0:714ffbdde11c | 25 | xout = 160+(x*80); |
JLS | 0:714ffbdde11c | 26 | yout = 120+(y*60); |
JLS | 0:714ffbdde11c | 27 | |
JLS | 0:714ffbdde11c | 28 | lcd.pixel(yout,xout,WHITE); |
JLS | 0:714ffbdde11c | 29 | |
JLS | 0:714ffbdde11c | 30 | } |
JLS | 0:714ffbdde11c | 31 | } |