-
Notifications
You must be signed in to change notification settings - Fork 6
/
BETABRITE.h
58 lines (50 loc) · 2.3 KB
/
BETABRITE.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* BETABRITE class for Arduino
by Tom Stewart (tastewar.com)
This library provides definitions and functions
for interfacing with a BetaBrite sign through a
Serial port
The documentation for the protocol that this code
is based on is (was) available at the time at:
http://www.alpha-american.com/alpha-manuals/M-Protocol.pdf
(c) 2011
*/
#ifndef BETABRITE_H
#define BETABRITE_H
#include <WProgram.h>
#include "BBDEFS.h"
#include "../NewSoftSerial/NewSoftSerial.h"
// following is based on Arduino forum user etracer's suggestion at
// http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1237301397
/* #ifdef DEVELOPMENT_MODE
#define SerialPort bbPort
#else
#define SerialPort Serial
#endif //DEVELOPMENT_MODE
*/
class BETABRITE : NewSoftSerial
{
public:
BETABRITE ( uint8_t receivePin, uint8_t transmitPin, const char Type=BB_ST_ALL, const char Address[2]=NULL );
~BETABRITE ( void );
void WriteTextFile ( const char Name, const char *Contents, const char initColor=BB_COL_AUTOCOLOR, const char Position=BB_DP_TOPLINE, const char Mode=BB_DM_COMPROTATE, const char Special=BB_SDM_TWINKLE );
void WriteTextFileNested ( const char Name, const char *Contents, const char initColor=BB_COL_AUTOCOLOR, const char Position=BB_DP_TOPLINE, const char Mode=BB_DM_COMPROTATE, const char Special=BB_SDM_TWINKLE );
void WritePriorityTextFile ( const char *Contents, const char initColor=BB_COL_AUTOCOLOR, const char Position=BB_DP_TOPLINE, const char Mode=BB_DM_COMPROTATE, const char Special=BB_SDM_TWINKLE );
void WritePriorityTextFileNested ( const char *Contents, const char initColor=BB_COL_AUTOCOLOR, const char Position=BB_DP_TOPLINE, const char Mode=BB_DM_COMPROTATE, const char Special=BB_SDM_TWINKLE );
void CancelPriorityTextFile ( void );
void WriteStringFile ( const char Name, const char *Contents );
void WriteStringFileNested ( const char Name, const char *Contents );
void SetMemoryConfiguration ( const char startingFile, unsigned int numFiles=26, unsigned int size=256 );
void BeginCommand ( void );
void BeginNestedCommand ( void );
void EndCommand ( void );
void EndNestedCommand ( void );
void DelayBetweenCommands ( void );
#ifdef DATEFUNCTIONS
void SetDateTime ( DateTime now, bool UseMilitaryTime=false );
#endif
private:
char _type;
char _address[2];
void Sync ( void );
};
#endif //BETABRITE_H