3 #include <mrm-action.h>
5 #include <mrm-common.h>
14 #define CAN_ID_8x8A0_IN 0x200
15 #define CAN_ID_8x8A0_OUT 0x201
16 #define CAN_ID_8x8A1_IN 0x202
17 #define CAN_ID_8x8A1_OUT 0x203
18 #define CAN_ID_8x8A2_IN 0x204
19 #define CAN_ID_8x8A2_OUT 0x205
20 #define CAN_ID_8x8A3_IN 0x206
21 #define CAN_ID_8x8A3_OUT 0x207
22 #define CAN_ID_8x8A4_IN 0x208
23 #define CAN_ID_8x8A4_OUT 0x209
24 #define CAN_ID_8x8A5_IN 0x20A
25 #define CAN_ID_8x8A5_OUT 0x20B
26 #define CAN_ID_8x8A6_IN 0x20C
27 #define CAN_ID_8x8A6_OUT 0x20D
28 #define CAN_ID_8x8A7_IN 0x20E
29 #define CAN_ID_8x8A7_OUT 0x20F
32 #define COMMAND_8X8_DISPLAY 0x00
33 #define COMMAND_8X8_SWITCH_ON 0x01
34 #define COMMAND_8X8_SWITCH_ON_REQUEST_NOTIFICATION 0x02
35 #define COMMAND_8x8_TEST_CAN_BUS 0x03
36 #define COMMAND_8X8_BITMAP_DISPLAY_PART1 0x05
37 #define COMMAND_8X8_BITMAP_DISPLAY_PART2 0x06
38 #define COMMAND_8X8_BITMAP_DISPLAY_PART3 0x07
39 #define COMMAND_8X8_BITMAP_STORE_PART1 0x08
40 #define COMMAND_8X8_BITMAP_STORE_PART2 0x09
41 #define COMMAND_8X8_BITMAP_STORE_PART3 0x0A
42 #define COMMAND_8X8_BITMAP_STORED_DISPLAY 0x0B
43 #define COMMAND_8X8_ROTATION_SET 0x0C
44 #define COMMAND_8X8_TEXT_1 0x50
45 #define COMMAND_8X8_TEXT_2 0x51
46 #define COMMAND_8X8_TEXT_3 0x52
47 #define COMMAND_8X8_TEXT_4 0x53
48 #define COMMAND_8X8_TEXT_5 0x54
49 #define COMMAND_8X8_TEXT_6 0x55
51 #define MRM_8x8A_SWITCHES_COUNT 4
52 #define MRM_8X8A_TEXT_LENGTH 44
54 #define MRM_8X8A_INACTIVITY_ALLOWED_MS 30000
56 enum LED8x8Rotation { LED_8X8_BY_0_DEGREES, LED_8X8_BY_90_DEGREES, LED_8X8_BY_270_DEGREES };
57 enum LED8x8Type{LED_8X8_CUSTOM, LED_8X8_STORED, LED_8X8_STORED_CUSTOM };
61 bool _activeCheckIfStarted =
true;
62 std::vector<uint8_t>* displayedLast;
63 std::vector<uint8_t>* displayedTypeLast;
64 std::vector<bool[MRM_8x8A_SWITCHES_COUNT]>* lastOn;
65 std::vector<bool[MRM_8x8A_SWITCHES_COUNT]>* on;
66 std::vector<ActionBase *[MRM_8x8A_SWITCHES_COUNT]>* offOnAction;
72 bool started(uint8_t deviceNumber);
91 void actionSet(
ActionBase* action, uint8_t switchNumber, uint8_t deviceNumber = 0);
96 void add(
char * deviceName = (
char*)
"");
102 void bitmapDisplay(uint8_t bitmapId, uint8_t deviceNumber = 0);
117 void bitmapCustomStore(uint8_t red[], uint8_t green[], uint8_t address, uint8_t deviceNumber = 0);
144 void rotationSet(
enum LED8x8Rotation rotation = LED_8X8_BY_0_DEGREES, uint8_t deviceNumber = 0);
151 bool switchRead(uint8_t switchNumber, uint8_t deviceNumber = 0);
157 void text(
char content[], uint8_t deviceNumber = 0);
Definition: mrm-action.h:7
void reset(uint8_t deviceNumber=0xFF)
Definition: mrm-board.cpp:425
Definition: mrm-8x8a.h:60
Mrm_8x8a(Robot *robot=NULL, uint8_t maxDevices=1)
Definition: mrm-8x8a.cpp:10
void add(char *deviceName=(char *)"")
Definition: mrm-8x8a.cpp:45
void bitmapDisplay(uint8_t bitmapId, uint8_t deviceNumber=0)
Definition: mrm-8x8a.cpp:101
void activeCheckIfStartedSet(bool value)
Definition: mrm-8x8a.h:87
bool messageDecode(uint32_t canId, uint8_t data[8])
Definition: mrm-8x8a.cpp:185
void test()
Definition: mrm-8x8a.cpp:330
bool switchRead(uint8_t switchNumber, uint8_t deviceNumber=0)
Definition: mrm-8x8a.cpp:314
bool progressBar(uint32_t period, uint32_t current, bool reset=false)
Definition: mrm-8x8a.cpp:228
void bitmapCustomDisplay(uint8_t red[], uint8_t green[], uint8_t deviceNumber=0)
Definition: mrm-8x8a.cpp:117
void rotationSet(enum LED8x8Rotation rotation=LED_8X8_BY_0_DEGREES, uint8_t deviceNumber=0)
Definition: mrm-8x8a.cpp:277
void bitmapCustomStoredDisplay(uint8_t address, uint8_t deviceNumber=0)
Definition: mrm-8x8a.cpp:169
void text(char content[], uint8_t deviceNumber=0)
Definition: mrm-8x8a.cpp:385
void bitmapCustomStore(uint8_t red[], uint8_t green[], uint8_t address, uint8_t deviceNumber=0)
Definition: mrm-8x8a.cpp:144
Definition: mrm-robot.h:42
Definition: mrm-board.h:356