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@1:be9de147b3d1, 2010-12-26 (annotated)
- Committer:
- JLS
- Date:
- Sun Dec 26 20:28:40 2010 +0000
- Revision:
- 1:be9de147b3d1
- Parent:
- 0:714ffbdde11c
update
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 | while (1) { |
| JLS | 0:714ffbdde11c | 17 | |
| JLS | 0:714ffbdde11c | 18 | double oldX = x; |
| JLS | 0:714ffbdde11c | 19 | |
| JLS | 0:714ffbdde11c | 20 | x = y; |
| JLS | 0:714ffbdde11c | 21 | y = -b*oldX+a*y-pow(y,3); |
| JLS | 0:714ffbdde11c | 22 | |
| JLS | 0:714ffbdde11c | 23 | xout = 160+(x*80); |
| JLS | 0:714ffbdde11c | 24 | yout = 120+(y*60); |
| JLS | 0:714ffbdde11c | 25 | |
| JLS | 0:714ffbdde11c | 26 | lcd.pixel(yout,xout,WHITE); |
| JLS | 0:714ffbdde11c | 27 | |
| JLS | 0:714ffbdde11c | 28 | } |
| JLS | 0:714ffbdde11c | 29 | } |