Simple demo for SerialPlotter program found at following link https://developer.mbed.org/users/borislav/notebook/serial-port-plotter/
Revision 2:7a66c77ff328, committed 2017-09-07
- Comitter:
- j3
- Date:
- Thu Sep 07 23:37:31 2017 +0000
- Parent:
- 1:0951a80a60e2
- Commit message:
- added notes on fixing negative val plotting for GUI
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 0951a80a60e2 -r 7a66c77ff328 main.cpp --- a/main.cpp Thu Sep 07 23:02:08 2017 +0000 +++ b/main.cpp Thu Sep 07 23:37:31 2017 +0000 @@ -28,7 +28,6 @@ #include "mbed.h" - int32_t float_to_int(float f); @@ -54,8 +53,22 @@ //get data for(uint32_t idx = 0; idx < 3; idx++) { - //get sin, scaled up and offset above 0 - sinScaled = (100 + (100.0F * sin(angle[idx]*(PI/180.0F)))); + /*If you have Qt creator installed, you can open the SerialPlotter + project and edit line 440 of mainwindow.cpp too the following + + //else if(isdigit(temp[i]) || isspace(temp[i]) || temp[i] == '-') + + without the comment, of course. + + If you dont, use the commented out version of sinScaled below and + comment the first one out. + */ + + //get sin, scaled up + sinScaled = (100.0F * sin(angle[idx]*(PI/180.0F))); + + //sinScaled = (100 + (100.0F * sin(angle[idx]*(PI/180.0F)))); + data[idx] = float_to_int(sinScaled); //inc angle, check for roll over