Rob Keij / TOGGLE
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers toggle.cpp Source File

toggle.cpp

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