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を指定してからご利用下さい。

album description edit information description

BlinkLed.cpp

Committer:
togayan
Date:
2012-08-22
Revision:
0:dfd5cfea7112
Child:
5:66c3398a14c9

File content as of revision 0:dfd5cfea7112:

#include "BlinkLed.h"
    
BlinkLed::BlinkLed(PinName pin, float dutyChangeStep, const char* name) :
led(pin, name),
dutyChangeStep(dutyChangeStep),
thread(0)
{
}

BlinkLed::~BlinkLed()
{
}

void BlinkLed::startBlink()
{
    if(thread == 0)
    {
        thread = new Thread(blink, this, osPriorityNormal, 128, NULL);
    }
}

void BlinkLed::finishBlink()
{
    if(thread != 0)
    {
        thread->terminate();
        delete thread;
        thread = 0;
        led = 0.0;
    }
}

void BlinkLed::blink(void const *argument)
{
    BlinkLed* blinkLed = (BlinkLed*)argument;
    
    int up = 1;
    float brightness = 0.0;
    while (1) {
        if (up == 1 && brightness < 1.0) {
            ;
        } else if (up == 1 && brightness >= 1.0) {
            up = 0;
        } else if (up == 0 && brightness > 0) {
            ;
        } else if (up == 0 && brightness <= 0.0) {
            up = 1;
        } else {
            error("LED PWM error\n");
        }
        
        float dutyChangeStep = blinkLed->dutyChangeStep;
        if (up == 1) {
            brightness += dutyChangeStep;
        } else {
            brightness -= dutyChangeStep;
        }
        blinkLed->led = brightness;
        
        Thread::wait(20);
    }
}