/elec/propeller-clock

To get this branch, use:
bzr branch http://bzr.ed.am/elec/propeller-clock

« back to all changes in this revision

Viewing changes to src/modes/analogue_clock_mode.h

  • Committer: Tim Marston
  • Date: 2013-03-31 17:07:11 UTC
  • Revision ID: tim@ed.am-20130331170711-okfhn3wx9y0eo99a
updated the schematic to increase minimum font size

Show diffs side-by-side

added added

removed removed

24
24
#define _ANALOGUE_CLOCK_MODE_H_
25
25
 
26
26
 
27
 
#include "minor_mode.h"
28
 
 
29
 
 
30
 
class AnalogueClockMode : public MinorMode
 
27
#include "mode.h"
 
28
 
 
29
 
 
30
class AnalogueClockMode : public Mode
31
31
{
32
32
public:
33
33
 
34
 
        AnalogueClockMode();
35
 
 
36
34
        /**
37
 
         * Draw an individual segment (column of pixels)
 
35
         * Called once per segment to draw a column of LEDs.
38
36
         *
39
 
         * @param segment the segment number
 
37
         * @param segment the segment number to draw
40
38
         */
41
39
        void draw( int segment );
42
40
 
43
41
        /**
44
 
         * Called before the first segment is drawn, once per "frame".
 
42
         * Called at the start of a "frame", before any segments are drawn.
45
43
         */
46
44
        void draw_reset();
47
45
 
 
46
        /**
 
47
         * Called when the mode is becoming active.
 
48
         */
 
49
        void activate();
 
50
 
 
51
        /**
 
52
         * Called when the button has been pressed.
 
53
         */
 
54
        void press();
 
55
 
48
56
private:
49
57
 
50
58
        /** the segment that the hour hand should be at */
56
64
        /** the segment that the second hand should be at */
57
65
        int _second_segment;
58
66
 
 
67
        /** the segment that the subsecond hand should be at */
 
68
        int _subsecond_segment;
 
69
 
 
70
        /** the flavour */
 
71
        int _flavour;
 
72
 
 
73
        /** number of elapsed milliseconds this second */
 
74
        unsigned long _second_millis;
59
75
};
60
76
 
61
77