Download NHK English news podcast automatically. This application requires mpod mother board. See also http://mbed.org/users/geodenx/notebook/mpod/
Dependencies: BlinkLed HTTPClient EthernetInterface FatFileSystemCpp MSCFileSystem mbed-rtos mbed
Download NHK English news podcast automatically. This application requires mpod mother board. See also http://mbed.org/users/geodenx/notebook/mpod/
Diff: BlinkLed.cpp
- Revision:
- 3:07562878d3c3
- Parent:
- 2:0da3a4508b46
diff -r 0da3a4508b46 -r 07562878d3c3 BlinkLed.cpp --- a/BlinkLed.cpp Sat Aug 18 16:46:40 2012 +0000 +++ b/BlinkLed.cpp Sun Aug 19 15:57:55 2012 +0000 @@ -1,8 +1,8 @@ #include "BlinkLed.h" -BlinkLed::BlinkLed(PinName pin, uint32_t millisecWait, const char* name) : +BlinkLed::BlinkLed(PinName pin, float dutyChangeStep, const char* name) : led(pin, name), -millisecWait(millisecWait), +dutyChangeStep(dutyChangeStep), thread(0) { } @@ -48,14 +48,15 @@ } else { error("LED PWM error\n"); } - + + float dutyChangeStep = blinkLed->dutyChangeStep; if (up == 1) { - brightness += 0.01; + brightness += dutyChangeStep; } else { - brightness -= 0.01; + brightness -= dutyChangeStep; } blinkLed->led = brightness; - Thread::wait(blinkLed->millisecWait); + Thread::wait(20); } }