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.
ballsens.h
00001 #ifndef BALLSENS_H 00002 #define BALLSENS_H 00003 00004 #include "mbed.h" 00005 #include "PCA9555.h" 00006 00007 class BallSens { 00008 protected: 00009 FunctionPointer _callbackChange; 00010 public: 00011 BallSens(PCA9555 *ioExt, unsigned int ballPin); 00012 bool read(); 00013 00014 void change(void (*function)(void)); 00015 00016 template<typename T> 00017 void change(T *object, void (T::*member)(void)) { 00018 _callbackChange.attach(object, member); 00019 } 00020 00021 private: 00022 bool ballState; 00023 PCA9555 *extIO; 00024 unsigned int ballPinNumber; 00025 00026 void callChange(void); 00027 00028 void setState(bool newState); 00029 }; 00030 00031 #endif
Generated on Tue Jul 19 2022 00:06:39 by
1.7.2