As of Monday morning, so this is the code we showed at Uncraftivism.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Blinker.h Source File

Blinker.h

00001 #pragma once
00002 
00003 #include "ServoMinder.h"
00004 class Blinker
00005 {
00006 public:
00007     Blinker( ServoMinder *servoMinder );
00008 
00009     void blink();
00010     void close();
00011     void open();
00012     void setSleepiness( float sleepiness );
00013     void setBoredom( float boredom );
00014      
00015 private:
00016    
00017 
00018     ServoMinder *m_servoMinder;
00019     
00020     float m_boredom;
00021     float m_sleepiness;
00022     float m_tickTime;
00023     Ticker m_ticker;
00024     float m_nextMove;
00025     
00026     float m_blinkTimer;
00027 
00028     float speedForSleepiness();
00029     float openPosForSleepiness();
00030     
00031     void tick();
00032 
00033 };