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: PololuLedStrip mbed
Rotary.h
00001 #ifndef ROTARY_H 00002 #define ROTARY_H 00003 00004 #include "mbed.h" 00005 00006 class Rotary { 00007 public: 00008 enum Action { 00009 NONE, LEFT, RIGHT, TIMEOUT 00010 }; 00011 00012 #ifdef DEV 00013 static const uint32_t TIMEOUT_MILLIS = 20 * 1000UL; 00014 #else 00015 static const uint32_t TIMEOUT_MILLIS = 120 * 1000UL; 00016 #endif 00017 00018 Rotary(PinName _pinA, PinName _pinB); 00019 Action read(); 00020 Action waitForAction(); 00021 00022 private: 00023 uint8_t _prevPos, _flags; 00024 DigitalIn pinA, pinB; 00025 uint8_t readEnc(); 00026 }; 00027 00028 #endif
Generated on Tue Jul 19 2022 02:43:48 by
1.7.2