flash one led

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Flasher.cpp Source File

Flasher.cpp

00001 //Flasher.cpp
00002 
00003 #include "Flasher.h"
00004 #include "mbed.h"
00005  
00006 Flasher::Flasher(PinName pin) : _pin(pin) {
00007     _pin = 0;
00008 }
00009  
00010 void Flasher::flash(int n) {
00011     for(int i=0; i<n*2; i++) {
00012         _pin = !_pin;
00013         wait(0.2);
00014     }
00015 }