mirror of
https://github.com/geekammo/MicroView-Arduino-Library.git
synced 2026-03-23 18:36:51 +01:00
Add uView.scrollLeft() function.
Same as existing uView.scrollRight() but in the opposite direction.
This commit is contained in:
@@ -858,13 +858,26 @@ void MicroView::scrollStop(void){
|
|||||||
*/
|
*/
|
||||||
void MicroView::scrollRight(uint8_t start, uint8_t stop){
|
void MicroView::scrollRight(uint8_t start, uint8_t stop){
|
||||||
if (stop<start) // stop must be larger or equal to start
|
if (stop<start) // stop must be larger or equal to start
|
||||||
return;
|
return;
|
||||||
scrollStop(); // need to disable scrolling before starting to avoid memory corrupt
|
scrollStop(); // need to disable scrolling before starting to avoid memory corrupt
|
||||||
command(RIGHTHORIZONTALSCROLL, 0);
|
command(RIGHTHORIZONTALSCROLL, 0);
|
||||||
command(start, 0x7, stop); // scroll speed frames , TODO
|
command(start, 0x7, stop); // scroll speed frames , TODO
|
||||||
command(0x00, 0xFF, ACTIVATESCROLL);
|
command(0x00, 0xFF, ACTIVATESCROLL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Left scrolling.
|
||||||
|
|
||||||
|
Set row start to row stop on the OLED to scroll left. Refer to http://learn.microview.io/intro/general-overview-of-microview.html for explanation of the rows.
|
||||||
|
*/
|
||||||
|
void MicroView::scrollLeft(uint8_t start, uint8_t stop){
|
||||||
|
if (stop<start) // stop must be larger or equal to start
|
||||||
|
return;
|
||||||
|
scrollStop(); // need to disable scrolling before starting to avoid memory corrupt
|
||||||
|
command(LEFTHORIZONTALSCROLL, 0);
|
||||||
|
command(start, 0x7, stop); // scroll speed frames , TODO
|
||||||
|
command(0x00, 0xFF, ACTIVATESCROLL);
|
||||||
|
}
|
||||||
|
|
||||||
/** \brief Vertical flip.
|
/** \brief Vertical flip.
|
||||||
|
|
||||||
Flip the graphics on the OLED vertically.
|
Flip the graphics on the OLED vertically.
|
||||||
|
|||||||
@@ -114,7 +114,7 @@
|
|||||||
#define DEACTIVATESCROLL 0x2E
|
#define DEACTIVATESCROLL 0x2E
|
||||||
#define SETVERTICALSCROLLAREA 0xA3
|
#define SETVERTICALSCROLLAREA 0xA3
|
||||||
#define RIGHTHORIZONTALSCROLL 0x26
|
#define RIGHTHORIZONTALSCROLL 0x26
|
||||||
#define LEFT_HORIZONTALSCROLL 0x27
|
#define LEFTHORIZONTALSCROLL 0x27
|
||||||
#define VERTICALRIGHTHORIZONTALSCROLL 0x29
|
#define VERTICALRIGHTHORIZONTALSCROLL 0x29
|
||||||
#define VERTICALLEFTHORIZONTALSCROLL 0x2A
|
#define VERTICALLEFTHORIZONTALSCROLL 0x2A
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user