00001 // SetterDebug.h 00002 // 00003 // Class for testing and debugging Setter and subclasses 00004 /// \author Mike McCauley (mikem@open.com.au) 00005 /// 00006 // Copyright (C) 2010 Mike McCauley 00007 // $Id: SetterDebug.h,v 1.3 2010/06/28 00:56:10 mikem Exp $ 00008 00009 #ifndef SetterDebug_h 00010 #define SetterDebug_h 00011 00012 #include "Setter.h" 00013 #if ARDUINO >= 100 00014 #include <Arduino.h> 00015 #else 00016 #include <wiring.h> 00017 #endif 00018 00019 ///////////////////////////////////////////////////////////////////// 00020 /// \class SetterDebug SetterDebug.h <SetterDebug.h> 00021 /// \brief Class for testing Setters. 00022 /// Used by the sample TestSuite sketch. 00023 /// 00024 class SetterDebug : public Setter 00025 { 00026 public: 00027 /// Input the value to be inverted 00028 /// \param[in] value The input value 00029 virtual void input(int value); 00030 00031 /// Return the last value that 00032 /// was set here 00033 int lastValue(); 00034 00035 /// Called when the source of input data is lost, 00036 /// and the Setter is required to fail in a safe way 00037 virtual void failsafe(); 00038 00039 /// Returns whether there has been a 00040 /// failsafe event 00041 boolean failed(); 00042 00043 protected: 00044 00045 private: 00046 int _lastValue; 00047 boolean _failed; 00048 }; 00049 00050 #endif