Satoshi Iyobe / TB6612FNG

Dependents:   measure_1_BBB measure_1_CCC measure_1_DDD

Revision:
1:4c4f2d25dc05
Parent:
0:085abb7f6992
--- 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()