diff options
author | Joel Bodenmann <joel@embedded.pro> | 2017-09-26 14:47:36 +0200 |
---|---|---|
committer | Joel Bodenmann <joel@embedded.pro> | 2017-09-26 14:47:36 +0200 |
commit | 8219311877068aee7e8913ed2a9f2085a1e830e8 (patch) | |
tree | fbfa97f741d909e65693a6be1eccf0fbc694b390 /demos | |
parent | 2513b54e71090572b2cf5789389c866b22a47068 (diff) | |
download | uGFX-8219311877068aee7e8913ed2a9f2085a1e830e8.tar.gz uGFX-8219311877068aee7e8913ed2a9f2085a1e830e8.tar.bz2 uGFX-8219311877068aee7e8913ed2a9f2085a1e830e8.zip |
using GFX_PI instead of M_PI in graph demo
Diffstat (limited to 'demos')
-rw-r--r-- | demos/modules/gwin/graph/main.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/demos/modules/gwin/graph/main.c b/demos/modules/gwin/graph/main.c index e0d82271..23a6a564 100644 --- a/demos/modules/gwin/graph/main.c +++ b/demos/modules/gwin/graph/main.c @@ -77,25 +77,25 @@ int main(void) { wi.height = gdispGetHeight(); gh = gwinGraphCreate(0, &wi); } - + // Set the graph origin and style gwinGraphSetOrigin(gh, gwinGetWidth(gh)/2, gwinGetHeight(gh)/2); gwinGraphSetStyle(gh, &GraphStyle1); gwinGraphDrawAxis(gh); - + // Draw a sine wave for(i = 0; i < gwinGetWidth(gh); i++) { - gwinGraphDrawPoint(gh, i-gwinGetWidth(gh)/2, 80*sin(2*0.2*M_PI*i/180)); + gwinGraphDrawPoint(gh, i-gwinGetWidth(gh)/2, 80*sin(2*0.2*GFX_PI*i/180)); } - + // Modify the style gwinGraphStartSet(gh); GraphStyle1.point.color = Green; gwinGraphSetStyle(gh, &GraphStyle1); - + // Draw a different sine wave for(i = 0; i < gwinGetWidth(gh)*5; i++) { - gwinGraphDrawPoint(gh, i/5-gwinGetWidth(gh)/2, 95*sin(2*0.2*M_PI*i/180)); + gwinGraphDrawPoint(gh, i/5-gwinGetWidth(gh)/2, 95*sin(2*0.2*GFX_PI*i/180)); } // Change to a completely different style @@ -104,7 +104,7 @@ int main(void) { // Draw a set of points gwinGraphDrawPoints(gh, data, sizeof(data)/sizeof(data[0])); - + while(TRUE) { gfxSleepMilliseconds(100); } |