Francesco Bianchi / Flasher
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Flasher.h Source File

Flasher.h

00001 #ifndef FLASHER_H
00002 #define FLASHER_H
00003  
00004 #include "mbed.h"
00005 
00006 /**Flasher class
00007  * Used to flash a pin # times
00008  *
00009  * Example:
00010  * @code
00011  * #include "mbed.h"
00012  * #include "Flasher.h"
00013  *
00014  * Flasher led(LED2);
00015  * 
00016  * int main() {
00017  *    led.flash(5); //flash LED2 5 times
00018  * } 
00019  * @endcode
00020  */
00021 class Flasher {
00022 public:
00023     /**Create Flasher instance
00024      *
00025      *@param pin Mbed pin reference
00026      */    
00027     Flasher(PinName pin);
00028     
00029     /**Flash method
00030     *
00031     *@param n Number of flashes to perform
00032     */
00033     void flash(int n);
00034   
00035 private:  
00036     DigitalOut _pin;
00037 };
00038  
00039 #endif