added checkComm() function to communicate with host PC

This commit is contained in:
JP
2014-02-15 10:15:03 +11:00
parent 7fd29e3c92
commit 93beac25d5
4 changed files with 38 additions and 21 deletions

View File

@@ -719,6 +719,7 @@ size_t MicroView::write(uint8_t c) {
display();
} else if (cmdCount=4) {
pixel(serCmd[1],serCmd[2],serCmd[3],serCmd[4]);
display();
}
break;
}

View File

@@ -65,25 +65,25 @@
#define VERTICALLEFTHORIZONTALSCROLL 0x2A
typedef enum CMD {
CMD_CLEAR,
CMD_INVERT,
CMD_CONTRAST,
CMD_DISPLAY,
CMD_SETCURSOR,
CMD_PIXEL,
CMD_LINE,
CMD_LINEH,
CMD_LINEV,
CMD_RECT,
CMD_RECTFILL,
CMD_CIRCLE,
CMD_CIRCLEFILL,
CMD_DRAWCHAR,
CMD_DRAWBITMAP,
CMD_GETLCDWIDTH,
CMD_GETLCDHEIGHT,
CMD_SETCOLOR,
CMD_SETDRAWMODE
CMD_CLEAR, //0
CMD_INVERT, //1
CMD_CONTRAST, //2
CMD_DISPLAY, //3
CMD_SETCURSOR, //4
CMD_PIXEL, //5
CMD_LINE, //6
CMD_LINEH, //7
CMD_LINEV, //8
CMD_RECT, //9
CMD_RECTFILL, //10
CMD_CIRCLE, //11
CMD_CIRCLEFILL, //12
CMD_DRAWCHAR, //13
CMD_DRAWBITMAP, //14
CMD_GETLCDWIDTH, //15
CMD_GETLCDHEIGHT, //16
CMD_SETCOLOR, //17
CMD_SETDRAWMODE //18
} commCommand_t;
class MicroView : public Print{
@@ -103,7 +103,7 @@ public:
void setColumnAddress(uint8_t add);
void setPageAddress(uint8_t add);
// LCD Draw functions
// LCD Draw functions
void clear(uint8_t mode);
void clear(uint8_t mode, uint8_t c);
void invert(boolean inv);

View File

@@ -72,12 +72,27 @@ void loop() {
}
</code></pre>
### Example 4 - Communication
<pre><code>
#include &lt;MicroView.h&gt;
void setup() {
uView.begin();
uView.clear(PAGE);
}
void loop() {
uView.checkComm();
}
</code></pre>
## History
**v1.07b: 10th February by JP Liew**
**v1.07b: 15th February by JP Liew**
* changed function name stopScroll to scrollStop for consistency
* added contrast function
* added invert function
* added KEYWORD to keywords.txt
* added checkComm() function to communicate with host PC
**v1.06b: 9th February by JP Liew**
* fixed Slider negative value not working

View File

@@ -60,6 +60,7 @@ setMinValue KEYWORD2
setValue KEYWORD2
draw KEYWORD2
drawFace KEYWORD2
checkComm KEYWORD2
#######################################
# Constants (LITERAL1)