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 MIP8F_SPI_Ver60 MIP8f_FRDM_LineBuffer_sample MIP8f_FRDM_TransferMode_sample
Diff: StateSw/StateSW.h
- Revision:
- 0:33fe30a2b785
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/StateSw/StateSW.h Tue Sep 04 06:44:01 2018 +0000
@@ -0,0 +1,45 @@
+/* mbed StateSW Library without using PWM pins
+
+
+ */
+#include "mbed.h"
+
+class StateSW {
+
+public:
+ StateSW (PinName SWPin);
+
+ void Enable(int StateNum, int NoiseCancel, int OpenTime);
+ int State(void);
+ bool IfAtTime(void);
+ void IfCntState(bool IfCntState);
+ void IfCntClose(bool IfCntClose);
+ void IfCntOpen(bool IfCntOpen);
+ // void Reset(void);
+ // bool IfOnetime(void);
+
+protected:
+ int _STATENUM;
+ int _REPEAT;
+ int _OPNCNT;
+ int _State;
+
+ void _fall(void);
+ void _rise(void);
+ void _SeekPress(void);
+
+ DigitalIn _SW;
+ bool _preSW;
+ int _PressCount;
+
+ int _IfCntOpen;
+ int _IfCntClose;
+ bool _IfCntState;
+ bool _IfAtTime;
+
+ Timer _Timer_SW;
+ Ticker _StateCounter;
+
+};
+
+