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.
main.cpp
- Committer:
- akshay28
- Date:
- 2016-11-30
- Revision:
- 0:55ffb01ac6ca
File content as of revision 0:55ffb01ac6ca:
#include "mbed.h" class Flasher { public: Flasher(PinName pin) : _pin(pin) { // _pin(pin) means pass pin to the DigitalOut constructor _pin = 0; // default the output to 0 } void flash(int n) { for(int i=0; i<n*2; i++) { _pin = !_pin; wait(0.2); } } private: DigitalOut _pin; }; Flasher led(LED2); Flasher out(p6); int main() { led.flash(5); led.flash(2); out.flash(10); }