Skip to content

Commit 93beac2

Browse files
committed
added checkComm() function to communicate with host PC
1 parent 7fd29e3 commit 93beac2

File tree

4 files changed

+38
-21
lines changed

4 files changed

+38
-21
lines changed

MicroView.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,7 @@ size_t MicroView::write(uint8_t c) {
719719
display();
720720
} else if (cmdCount=4) {
721721
pixel(serCmd[1],serCmd[2],serCmd[3],serCmd[4]);
722+
display();
722723
}
723724
break;
724725
}

MicroView.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,25 @@
6565
#define VERTICALLEFTHORIZONTALSCROLL 0x2A
6666

6767
typedef enum CMD {
68-
CMD_CLEAR,
69-
CMD_INVERT,
70-
CMD_CONTRAST,
71-
CMD_DISPLAY,
72-
CMD_SETCURSOR,
73-
CMD_PIXEL,
74-
CMD_LINE,
75-
CMD_LINEH,
76-
CMD_LINEV,
77-
CMD_RECT,
78-
CMD_RECTFILL,
79-
CMD_CIRCLE,
80-
CMD_CIRCLEFILL,
81-
CMD_DRAWCHAR,
82-
CMD_DRAWBITMAP,
83-
CMD_GETLCDWIDTH,
84-
CMD_GETLCDHEIGHT,
85-
CMD_SETCOLOR,
86-
CMD_SETDRAWMODE
68+
CMD_CLEAR, //0
69+
CMD_INVERT, //1
70+
CMD_CONTRAST, //2
71+
CMD_DISPLAY, //3
72+
CMD_SETCURSOR, //4
73+
CMD_PIXEL, //5
74+
CMD_LINE, //6
75+
CMD_LINEH, //7
76+
CMD_LINEV, //8
77+
CMD_RECT, //9
78+
CMD_RECTFILL, //10
79+
CMD_CIRCLE, //11
80+
CMD_CIRCLEFILL, //12
81+
CMD_DRAWCHAR, //13
82+
CMD_DRAWBITMAP, //14
83+
CMD_GETLCDWIDTH, //15
84+
CMD_GETLCDHEIGHT, //16
85+
CMD_SETCOLOR, //17
86+
CMD_SETDRAWMODE //18
8787
} commCommand_t;
8888

8989
class MicroView : public Print{
@@ -103,7 +103,7 @@ class MicroView : public Print{
103103
void setColumnAddress(uint8_t add);
104104
void setPageAddress(uint8_t add);
105105

106-
// LCD Draw functions
106+
// LCD Draw functions
107107
void clear(uint8_t mode);
108108
void clear(uint8_t mode, uint8_t c);
109109
void invert(boolean inv);

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,27 @@ void loop() {
7272
}
7373
</code></pre>
7474

75+
### Example 4 - Communication
76+
<pre><code>
77+
#include &lt;MicroView.h&gt;
78+
79+
void setup() {
80+
uView.begin();
81+
uView.clear(PAGE);
82+
}
83+
84+
void loop() {
85+
uView.checkComm();
86+
}
87+
</code></pre>
88+
7589
## History
76-
**v1.07b: 10th February by JP Liew**
90+
**v1.07b: 15th February by JP Liew**
7791
* changed function name stopScroll to scrollStop for consistency
7892
* added contrast function
7993
* added invert function
8094
* added KEYWORD to keywords.txt
95+
* added checkComm() function to communicate with host PC
8196

8297
**v1.06b: 9th February by JP Liew**
8398
* fixed Slider negative value not working

keywords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ setMinValue KEYWORD2
6060
setValue KEYWORD2
6161
draw KEYWORD2
6262
drawFace KEYWORD2
63+
checkComm KEYWORD2
6364

6465
#######################################
6566
# Constants (LITERAL1)

0 commit comments

Comments
 (0)