Tasks Lens for Ubuntu Unity (11.10) to browse tasks on Remember The Milk

UPDATE: latest version

IMPORTANT NOTICE: This product uses the Remember The Milk API but is not endorsed or certified by Remember The Milk.

This is my third update for this Lens.

Unfortunately, as some of you might have noticed, the previous two have disappeared.

Anyway, here’s the last version of the Lens in all her splendor :D:

And here you can find the source code with installation instructions:

SOURCE CODE on GITHUB

IMPORTANT NOTICE: This product uses the Remember The Milk API but is not endorsed or certified by Remember The Milk.

Object-oriented blinking with Arduino

Yesterday I started programming again with Arduino.

First thing I setup the Eclipse environment and to test it I ran the very simple blink program.


void setup() {
 pinMode(13, OUTPUT);
 }

void loop() {
 digitalWrite(13, HIGH);
 delay(100);
 digitalWrite(13, LOW);
 delay(100);
 }

Then, I wanted to go OO, so I wrote a class to represent a blinking object!

Header:

class Blink {
 private:
 unsigned long _onInterval;
 unsigned long _offInterval;
 uint8_t _blinkingLedId;
 bool _ledActivity;

public:

Blink(unsigned long onInterval, unsigned long offInterval, uint8_t blinkingLedId);

void oneBlink();

void setLedActivity(bool ledActivity);
 };

Implementation:

Blink::Blink(unsigned long onInterval, unsigned long offInterval, uint8_t blinkingLedId) :
 _onInterval(onInterval), _offInterval(offInterval), _blinkingLedId(blinkingLedId)
 {
 _ledActivity = true;
 pinMode(_blinkingLedId, OUTPUT);
 }

void Blink::oneBlink()
 {
 // LED activity disabled?
 if (_ledActivity == false)
 return;

// ON
 digitalWrite(_blinkingLedId, HIGH);
 delay(_onInterval);

// OFF
 digitalWrite(_blinkingLedId, LOW);
 delay(_offInterval);
 }

void Blink::setLedActivity(bool ledActivity) {
 _ledActivity = ledActivity;
 }

Main:

Blink *b;

void setup() {
 b = new Blink(2000, 2000, 13);
 }

void loop() {
 b->oneBlink();
 }

Well, okay, OOP doesn’t add anything to the story here, but how about having a blinking object instead of a procedural set of blinking statements :D? Exciting!