Download picasa web albums photos 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 picasa web albums photos automatically.
This application requires mpod mother board.
Picasaウェブアルバムから、自動的に写真をダウンロードして、ディジタルフォトフレームに表示します。
動作させるには mpod マザーボード が必要です。
プログラムの中で、ご自分のアルバムのRSSファイルへのURLを指定してからご利用下さい。
BlinkLed.cpp
- Committer:
- togayan
- Date:
- 2012-08-28
- Revision:
- 5:66c3398a14c9
- Parent:
- 0:dfd5cfea7112
File content as of revision 5:66c3398a14c9:
#include "BlinkLed.h"
BlinkLed::BlinkLed(PinName pin, float dutyChangeStep, const char* name) :
led(pin, name),
dutyChangeStep(dutyChangeStep),
continueBlink(false),
thread(0)
{
}
BlinkLed::~BlinkLed()
{
}
void BlinkLed::startBlink()
{
if(continueBlink == false)
{
continueBlink = true;
thread = new Thread(blink, this, osPriorityNormal, 128, NULL);
}
}
void BlinkLed::finishBlink()
{
if(continueBlink == true)
{
continueBlink = false;
led = 0.0;
thread->terminate();
delete thread;
}
}
void BlinkLed::blink(void const *argument)
{
BlinkLed* blinkLed = (BlinkLed*)argument;
bool up = false;
float brightness = 0.0;
while (blinkLed->continueBlink == true)
{
if(brightness <= 0.0)
{
up = true;
}
else if(1.0 <= brightness)
{
up = false;
}
float dutyChangeStep = blinkLed->dutyChangeStep;
brightness += ((up)?(dutyChangeStep):(-dutyChangeStep));
blinkLed->led = brightness;
Thread::wait(20);
}
}
Satoshi Togawa