BlinkLed automatically. This library requires RTOS.

Dependents:   mpod_nhk_english mpod_picasa_photoframe mpod_nhk_english_spxml

This is a library that automatically blink LED

RTOS has been used. However, you do not need to be aware of the RTOS.

As with PwmOut, there are restrictions on the LED that you can use. See also PwmOut.

LEDを自動的に点滅させるライブラリです。

内部にRTOSを利用していますが、ユーザがそのことを意識する必要はありません。

使用できるLEDは、PwmOutと同様の制約があります。詳しくは、PwmOutを参照ください。

main.cpp

#include "mbed.h"
#include "BlinkLed.h"

BlinkLed led1(LED1, 0.02);
BlinkLed led2(LED2, 0.04);
BlinkLed led3(LED3, 0.06);
BlinkLed led4(LED4, 0.08);

int main()
{
    while(1) {
        led1.startBlink();
        Thread::wait(1000);

        led2.startBlink();
        Thread::wait(1000);

        led3.startBlink();
        Thread::wait(1000);

        led4.startBlink();
        Thread::wait(10000);

        led1.finishBlink();
        Thread::wait(1000);

        led2.finishBlink();
        Thread::wait(1000);

        led3.finishBlink();
        Thread::wait(1000);

        led4.finishBlink();
        Thread::wait(1000);
    }
}

Import library

Public Member Functions

  BlinkLed (PinName pin, float dutyChangeStep)
  Constructor.
  ~BlinkLed ()
  Destructor.
void  startBlink ()
  Start biinking.
void  finishBlink ()
  Finish biinking.

History

Add "isBlinking()" method. default tip

2012-12-24, by togayan [Mon, 24 Dec 2012 06:38:42 +0000] rev 2

Add "isBlinking()" method.


Use signal to stop blinking

2012-09-01, by togayan [Sat, 01 Sep 2012 11:08:44 +0000] rev 1

Use signal to stop blinking


1st revision of BlinkLed

2012-09-01, by togayan [Sat, 01 Sep 2012 04:02:02 +0000] rev 0

1st revision of BlinkLed