Funzioni di IO varie con seriale asincrona
Dependents: Nucleo_AsyncSerialIO
Fork of IOFuncLib by
Diff: IOFuncLib.cpp
- Revision:
- 0:f401aa69861a
- Child:
- 1:58f3784ad68e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/IOFuncLib.cpp Sat May 23 00:40:49 2015 +0000 @@ -0,0 +1,25 @@ +#include "IOFuncLib.h" +#include "mbed.h" + +Flasher::Flasher(PinName pin) : _pin(pin) +{ + _pin = 0; +} + +void Flasher::flash(int n) +{ + for(int i=0; i<n*2; i++) { + _pin = !_pin; + wait_ms(50); + } +} + +void Flasher::onOff(bool n) +{ + _pin=n; +} + +void Flasher::notPin() +{ + _pin = !_pin; +} \ No newline at end of file