v01
Revision 0:dd6924abf791, committed 2014-05-24
- Comitter:
- samtoshi
- Date:
- Sat May 24 07:27:45 2014 +0000
- Commit message:
- TM_Button_sensor
Changed in this revision
TM_Button_Sensor.cpp | Show annotated file Show diff for this revision Revisions of this file |
TM_Button_Sensor.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r dd6924abf791 TM_Button_Sensor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TM_Button_Sensor.cpp Sat May 24 07:27:45 2014 +0000 @@ -0,0 +1,24 @@ +#include "TM_Button_Sensor.h" +#include "mbed.h" + +//::は「の」の意味。:はコンストラクタの初期化をしているらしい。 +//下記の意味は +//Pwmout somename(p11); +//somename=1; +//と同じ意味TM + +TM_Button_Sensor::TM_Button_Sensor_obj(PinName pin) : TM_Button_pins(pin) +{ + TM_Button_pins= 0; +} + + +void TM_LED_Controller::ON() +{ + TM_LED_pins = 1.0f; +} + +void TM_LED_Controller::OFF() +{ + TM_LED_pins = 0; +}
diff -r 000000000000 -r dd6924abf791 TM_Button_Sensor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TM_Button_Sensor.h Sat May 24 07:27:45 2014 +0000 @@ -0,0 +1,21 @@ +#ifndef INCLUDED_TM_Button_Sensor_H +#define INCLUDED_TM_BUtton_Sensor_H + +#include "mbed.h" + +class TM_Button_Sensor +{ + + private: + DigitalIn TM_Button_pins; + + //これはLED(p19);のように使う。 + public: + TM_Button_Sensor_obj(PinName pin); + + void ON(); + void OFF(); + +}; + +#endif \ No newline at end of file