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.
Dependents: measure_1_BBB measure_1_CCC measure_1_DDD
Revision 1:4c4f2d25dc05, committed 2021-05-13
- Comitter:
- sato_shi
- Date:
- Thu May 13 05:11:37 2021 +0000
- Parent:
- 0:085abb7f6992
- Commit message:
- BBBBBBb;
Changed in this revision
| TB6612FNG.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 085abb7f6992 -r 4c4f2d25dc05 TB6612FNG.cpp
--- a/TB6612FNG.cpp Fri May 07 03:27:26 2021 +0000
+++ b/TB6612FNG.cpp Thu May 13 05:11:37 2021 +0000
@@ -13,8 +13,11 @@
}
void TB6612FNG::SetW(float W)
-{
- _PWM = W;
+{
+ if(0 <= W && W <= 1) _PWM = W;
+ else if(1 < W) _PWM = 1;
+ else _PWM = 0;
+
}
void TB6612FNG::Forward()