Ryo Od / RotaryEncoder

Dependents:   BSM02

Fork of RotaryEncoder by Shinichiro Nakamura

Files at this revision

API Documentation at this revision

Comitter:
ryood
Date:
Sun Jun 12 08:48:43 2016 +0000
Parent:
3:6736c3bf48c9
Child:
5:60c44df48016
Commit message:
setVal????????

Changed in this revision

RotaryEncoder.h Show annotated file Show diff for this revision Revisions of this file
--- a/RotaryEncoder.h	Wed May 25 01:08:22 2016 +0000
+++ b/RotaryEncoder.h	Sun Jun 12 08:48:43 2016 +0000
@@ -71,13 +71,24 @@
     /**
      * Get the value.
      *
-     * @param The value.
+     * @return The value.
      */
     int getVal() const {
         return val;
     }
 
     /**
+     * Set the value.
+     *
+     * @param The value.
+     */
+    void setVal(int _val) {
+        if (min <= _val && _val <= max) {
+            val = _val;
+        }
+    }
+    
+    /**
     * Set the ticker interval.
     *
     * @param The interval in microseconds.