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.
Dependencies: mbed Servo PM mbed-rtos hormone calculator
Revision 14:d084ea982238, committed 2019-11-10
- Comitter:
- worasuchad
- Date:
- Sun Nov 10 02:45:05 2019 +0000
- Parent:
- 13:38dba9cfa29d
- Commit message:
- add config;
Changed in this revision
| hormone.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/hormone.lib Sun Sep 02 04:43:00 2018 +0000 +++ b/hormone.lib Sun Nov 10 02:45:05 2019 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/users/worasuchad/code/hormone/#6da425fac1f7 +https://os.mbed.com/users/worasuchad/code/hormone/#91e508c05dca
--- a/main.cpp Sun Sep 02 04:43:00 2018 +0000
+++ b/main.cpp Sun Nov 10 02:45:05 2019 +0000
@@ -24,6 +24,8 @@
#include "hormone.h"
#include "PowerMon.h"
+#define INITCONFIG 3 // 0-default, 1-flat, 2-small, 3-big roughtness
+
Serial pc(USBTX, USBRX); // Serial Port
Timer timer1;
Thread thread1;
@@ -56,28 +58,37 @@
// home variable
int initCheck = 0;
float waittime = 0.001 ;
-int round = 25;
+int round = 8;
// pm variable
int iterPM = 0;
float sumOfPower = 0.0, Energy = 0.0;
// interface wt hormone variable
-/*
-// config flat //
-float upDeg = 45.00;
-float downDeg = 95.00;
-*/
+#if(INITCONFIG == 0)
+ // default config //
+ float upDeg = 45.00;
+ float downDeg = 90.00;
+#endif
+
+#if(INITCONFIG == 1)
+ // config flat //
+ float upDeg = 45.00;
+ float downDeg = 95.00;
+#endif
+
+#if(INITCONFIG == 2)
+ // config small //
+ float upDeg = 60.00;
+ float downDeg = 100.00;
+#endif
-// config small //
-float upDeg = 60.00;
-float downDeg = 100.00;
+#if(INITCONFIG == 3)
+ // config big //
+ float upDeg = 75.00;
+ float downDeg = 90.00;
+#endif
-/*
-// config big //
-float upDeg = 75.00;
-float downDeg = 90.00;
-*/
// servo motor variable
float pos_down_start = 1400.00;
float pos_up_start = 1000.00;