27
27
#include "Arduino.h"
31
static int _flavour = 0;
34
static void reset_messages()
31
void InfoMode::draw_reset()
39
Text::reset_message( 0, Text::MODE_TOP | Text::MODE_THREEQUARTERS );
36
PString str0( Text::_messages[ 0 ], MESSAGE_LEN * 4 );
39
"Propeller Clock mk.1 ... "
40
"Created by Tim and Dan Marston in 2012 ... "
41
"http://ed.am/dev/elec/propeller-clock" );
42
Text::set_message_text( 0, str0 );
42
Text::reset_message( 0, Text::MODE_TOP | Text::MODE_HALF );
43
Text::reset_message( 1, Text::MODE_BOTTOM | Text::MODE_HALF );
46
PString str0( Text::_messages[ 0 ], MESSAGE_LEN );
47
PString str1( Text::_messages[ 1 ], MESSAGE_LEN );
51
unsigned long millis = ::millis();
53
(unsigned long)60 * 1000 / ( millis - _millis_last ) );
54
_millis_last = millis;
55
Text::set_message_text( 0, str0 );
56
Text::set_message_text( 1, str1 );
49
void info_mode_press()
63
void InfoMode::activate()
66
_millis_last = ::millis();
72
void InfoMode::press()
51
74
if( ++_flavour >= 2 )
59
void info_mode_draw( int segment )
61
Text::draw( 0, segment );
63
Text::draw( 1, segment );
67
void info_mode_draw_reset()
69
PString str0( Text::_messages[ 0 ], MESSAGE_LEN );
70
PString str1( Text::_messages[ 1 ], MESSAGE_LEN );
81
void InfoMode::reset_messages()
78
"Propeller Clock mk.1 ... "
79
"Created by Tim and Dan Marston in 2011 ... "
80
"http://ed.am/dev/elec/propeller-clock" );
88
Text::set_up_message( 0, Text::MODE_TOP | Text::MODE_THREEQUARTERS |
89
Text::MODE_HSCROLL, Text::SCALE_SMALL );
84
str1.format( "%d", 123 );
92
Text::set_up_message( 0, Text::MODE_TOP | Text::MODE_HALF,
94
Text::set_up_message( 1, Text::MODE_BOTTOM | Text::MODE_HALF,
88
Text::set_message( 0, str0 );
89
Text::set_message( 1, str1 );
93
void info_mode_activate()