-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added exmaple4 scrolling text on feather
- Loading branch information
1 parent
7bbb3cd
commit 7160d10
Showing
2 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
examples/Example4_ScrollingTextonFeather/Example4_ScrollingTextonFeather.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/****************************************************************************** | ||
Displays a text on the display scrolling from right to left | ||
[email protected] | ||
Original Creation Date: Oct. 18, 2019 | ||
This code is Beerware; if you see me at the local, | ||
and you've found our code helpful, please buy us a round! | ||
Hardware Connections: | ||
Connect DOGM128-6 to Arduino UNO. Use Hardware SPI. | ||
SI = 11 (Hardware SPI) | ||
SCLK = 13 (Hardware SPI) | ||
CS = 6 | ||
A0 = 8 | ||
RESET = 9 | ||
Backlight (if needed) is connected via a transistor to pin 10) | ||
Distributed as-is; no warranty is given. | ||
******************************************************************************/ | ||
#include <DogGraphicDisplay.h> | ||
#include "ubuntumono_b_16.h" | ||
|
||
#define BACKLIGHTPIN 10 | ||
|
||
DogGraphicDisplay DOG; | ||
|
||
void setup() { | ||
pinMode(BACKLIGHTPIN, OUTPUT); // set backlight pin to output | ||
digitalWrite(BACKLIGHTPIN, HIGH); // enable backlight pin | ||
|
||
DOG.begin(6,0,0,8,9,DOGM128); //CS = 6, 0,0= use Hardware SPI, A0 = 8, RESET = 9, EA DOGM128-6 (=128x64 dots) | ||
|
||
DOG.clear(); //clear whole display | ||
} | ||
|
||
void loop() { | ||
static int offset=DOG.display_width(); // static variable with the size of the display, so text starts at the right border | ||
|
||
DOG.string(offset,3,UBUNTUMONO_B_16,"Hello to the scrolling World!"); // print "Hello World" in line 3 at position offset | ||
|
||
offset--; // decrasye offset so text moves to the left | ||
if(offset<-232) offset=DOG.display_width(); //our text is 232 pixels wide so restart at this value | ||
|
||
delay(40); // wait a little bit | ||
} |
111 changes: 111 additions & 0 deletions
111
examples/Example4_ScrollingTextonFeather/ubuntumono_b_16.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
/* file generated by freetype converter 0.1 - 2019-06-23 */ | ||
/* find the latest version on https://github.com/generationmake/freetypeconverter */ | ||
/* converter called with: */ | ||
/* ./freetypeconverter -n UBUNTUMONO_B_16 -f /usr/share/fonts/truetype/ubuntu/UbuntuMono-B.ttf */ | ||
|
||
#define UBUNTUMONO_B_16_LEN 1528 | ||
#if defined(ARDUINO_ARCH_AVR) | ||
// AVR-specific code | ||
const byte UBUNTUMONO_B_16[UBUNTUMONO_B_16_LEN] __attribute__((section(".progmem.data"))) = | ||
#else | ||
// generic, non-platform specific code | ||
const byte UBUNTUMONO_B_16[UBUNTUMONO_B_16_LEN] = | ||
#endif | ||
{ | ||
70,86,0x20,0x7E,8,16,2,16, | ||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | ||
0xFC,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x0D,0x0D,0x00,0x00,0x00,0x00,0x00,0x00, | ||
0x3E,0x3E,0x00,0x3E,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | ||
0x30,0x30,0xF0,0x3C,0xF0,0xFC,0x3C,0x30,0x03,0x0F,0x03,0x0F,0x0F,0x03,0x03,0x03, | ||
0x70,0xF8,0xDE,0xDE,0x98,0x18,0x00,0x00,0x06,0x0C,0x3C,0x3D,0x0F,0x07,0x00,0x00, | ||
0x3C,0x24,0x3C,0xC0,0x30,0x08,0x04,0x00,0x08,0x06,0x01,0x00,0x0F,0x09,0x0F,0x00, | ||
0x00,0xB8,0x7C,0xCC,0xBC,0x18,0xC0,0x00,0x07,0x0F,0x0C,0x0C,0x0F,0x07,0x0F,0x0C, | ||
0x3E,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | ||
0xE0,0xF8,0x1C,0x06,0x02,0x00,0x00,0x00,0x07,0x1F,0x38,0x70,0x20,0x00,0x00,0x00, | ||
0x02,0x06,0x0C,0x18,0xF0,0xE0,0x00,0x00,0x00,0x60,0x30,0x3C,0x0F,0x07,0x00,0x00, | ||
0x30,0xB0,0xE0,0x7C,0xE0,0xB0,0x30,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00, | ||
0x80,0x80,0x80,0xF0,0xF0,0x80,0x80,0x80,0x01,0x01,0x01,0x0F,0x0F,0x01,0x01,0x01, | ||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x6E,0x3E,0x1E,0x00,0x00,0x00,0x00, | ||
0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00, | ||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x0E,0x04,0x00,0x00,0x00,0x00,0x00, | ||
0x00,0x00,0xC0,0xF8,0x3E,0x06,0x00,0x00,0x60,0x7E,0x1F,0x01,0x00,0x00,0x00,0x00, | ||
0xF0,0xFC,0xCC,0xCC,0xFC,0xF0,0x00,0x00,0x03,0x0F,0x0C,0x0C,0x0F,0x03,0x00,0x00, | ||
0x10,0x18,0x18,0xFC,0xFC,0x00,0x00,0x00,0x00,0x0C,0x0C,0x0F,0x0F,0x0C,0x0C,0x00, | ||
0x08,0x0C,0x8C,0xCC,0x7C,0x38,0x00,0x00,0x0E,0x0F,0x0D,0x0C,0x0C,0x0C,0x00,0x00, | ||
0x08,0xCC,0xCC,0xCC,0xFC,0x38,0x00,0x00,0x0C,0x0C,0x0C,0x0C,0x0F,0x07,0x00,0x00, | ||
0x80,0xC0,0x70,0x18,0xFC,0xFC,0x00,0x00,0x03,0x03,0x03,0x03,0x0F,0x0F,0x03,0x00, | ||
0x00,0x7C,0x7C,0xEC,0xEC,0xCC,0x00,0x00,0x0C,0x0C,0x0C,0x0C,0x07,0x07,0x00,0x00, | ||
0xE0,0xF0,0xD8,0xCC,0xCC,0x8C,0x00,0x00,0x07,0x0F,0x0C,0x0C,0x0F,0x07,0x00,0x00, | ||
0x0C,0x0C,0x8C,0xEC,0x3C,0x1C,0x00,0x00,0x00,0x0E,0x0F,0x01,0x00,0x00,0x00,0x00, | ||
0xB8,0xFC,0xCC,0xCC,0xFC,0xB8,0x00,0x00,0x07,0x0F,0x0C,0x0C,0x0F,0x07,0x00,0x00, | ||
0x78,0xFC,0xCC,0xCC,0xFC,0xF0,0x00,0x00,0x00,0x0C,0x0C,0x06,0x07,0x01,0x00,0x00, | ||
0x20,0x70,0x20,0x00,0x00,0x00,0x00,0x00,0x04,0x0E,0x04,0x00,0x00,0x00,0x00,0x00, | ||
0x00,0x20,0x70,0x20,0x00,0x00,0x00,0x00,0x40,0x6E,0x3E,0x1E,0x00,0x00,0x00,0x00, | ||
0xF0,0xF0,0xF8,0x9C,0x0C,0x0E,0x00,0x00,0x00,0x00,0x01,0x03,0x03,0x07,0x00,0x00, | ||
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x06,0x00,0x00, | ||
0x0E,0x0C,0x9C,0xF8,0xF0,0xF0,0x00,0x00,0x07,0x03,0x03,0x01,0x00,0x00,0x00,0x00, | ||
0x08,0x8C,0x8C,0xCC,0x7C,0x38,0x00,0x00,0x00,0x0D,0x0D,0x00,0x00,0x00,0x00,0x00, | ||
0xE0,0x18,0xCC,0xEC,0x6C,0xFC,0xF8,0x00,0x07,0x18,0x37,0x2F,0x2C,0x2F,0x2F,0x00, | ||
0x00,0x80,0xF0,0x3C,0x3C,0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FC,0x00,0x0F,0x0F,0x00,0x00,0x03,0x0F,0x0F,0x00, | ||
0xF0,0xF8,0x0C,0x0C,0x0C,0xF8,0xF0,0x00,0x03,0x07,0x0C,0x0C,0x0C,0x07,0x03,0x00, | ||
0xFC,0xFC,0x8C,0x8C,0x8C,0xF8,0xF8,0x00,0x0F,0x0F,0x01,0x01,0x01,0x00,0x00,0x00, | ||
0xF0,0xF8,0x0C,0x0C,0x0C,0xF8,0xF0,0x00,0x03,0x07,0x0C,0x3C,0x3C,0x67,0x63,0x00, | ||
0xFC,0xFC,0x8C,0x8C,0xFC,0x78,0x00,0x00,0x0F,0x0F,0x03,0x07,0x0E,0x08,0x00,0x00, | ||
0x78,0x7C,0xEC,0xCC,0xCC,0x98,0x00,0x00,0x06,0x0C,0x0C,0x0C,0x0F,0x07,0x00,0x00, | ||
0x0C,0x0C,0x0C,0xFC,0xFC,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x0F,0x0F,0x00,0x00,0x00, | ||
0xFC,0xFC,0x00,0x00,0xFC,0xFC,0x00,0x00,0x07,0x0F,0x0C,0x0C,0x0F,0x07,0x00,0x00, | ||
0x3C,0xFC,0xC0,0x00,0xE0,0xFC,0x3C,0x00,0x00,0x01,0x0F,0x0C,0x0F,0x01,0x00,0x00, | ||
0xFC,0xFC,0x80,0x80,0x80,0xFC,0xFC,0x00,0x07,0x0F,0x0F,0x01,0x0F,0x0F,0x07,0x00, | ||
0x04,0x0C,0xB8,0xF0,0xF0,0xBC,0x0C,0x04,0x08,0x0E,0x07,0x01,0x01,0x07,0x0E,0x08, | ||
0x04,0x1C,0x78,0xC0,0xC0,0x78,0x1C,0x04,0x00,0x00,0x00,0x0F,0x0F,0x00,0x00,0x00, | ||
0x0C,0x0C,0xCC,0x7C,0x1C,0x0C,0x00,0x00,0x0C,0x0F,0x0D,0x0C,0x0C,0x0C,0x00,0x00, | ||
0xFE,0xFE,0x06,0x06,0x00,0x00,0x00,0x00,0x7F,0x7F,0x60,0x60,0x00,0x00,0x00,0x00, | ||
0x06,0x3E,0xF8,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x1F,0x7C,0x60,0x00,0x00, | ||
0x06,0x06,0xFE,0xFE,0x00,0x00,0x00,0x00,0x60,0x60,0x7F,0x7F,0x00,0x00,0x00,0x00, | ||
0x00,0x70,0x38,0x1C,0x1C,0x38,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | ||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, | ||
0x04,0x06,0x0C,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | ||
0x00,0xB0,0xB0,0xB0,0xB0,0xF0,0xE0,0x00,0x07,0x0F,0x0D,0x0D,0x0D,0x0F,0x0F,0x00, | ||
0xFE,0xFE,0x30,0x30,0xF0,0xE0,0x00,0x00,0x0F,0x0F,0x0C,0x0C,0x07,0x03,0x00,0x00, | ||
0xC0,0xE0,0x70,0x30,0x30,0x30,0x00,0x00,0x03,0x07,0x0E,0x0C,0x0C,0x0C,0x00,0x00, | ||
0xC0,0xF0,0x30,0x30,0x30,0xFE,0xFE,0x00,0x03,0x07,0x0E,0x0C,0x0C,0x0F,0x0F,0x00, | ||
0xC0,0xE0,0xB0,0xB0,0xB0,0xF0,0xC0,0x00,0x03,0x07,0x0D,0x0D,0x0D,0x0D,0x0D,0x00, | ||
0x30,0x30,0xFC,0xFE,0x36,0x36,0x36,0x06,0x00,0x00,0x0F,0x0F,0x00,0x00,0x00,0x00, | ||
0xC0,0xE0,0x70,0x30,0x30,0xF0,0xF0,0x00,0x03,0x6F,0x6C,0x6C,0x6C,0x7F,0x3F,0x00, | ||
0xFE,0xFE,0x30,0x30,0xF0,0xE0,0x00,0x00,0x0F,0x0F,0x00,0x00,0x0F,0x0F,0x00,0x00, | ||
0x30,0x36,0xF6,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x0F,0x0C,0x0C,0x0C,0x00, | ||
0x00,0x30,0x30,0x30,0xF6,0xF6,0x00,0x00,0x00,0x70,0x60,0x60,0x7F,0x3F,0x00,0x00, | ||
0xFE,0xFE,0x80,0xE0,0x70,0x30,0x10,0x00,0x0F,0x0F,0x01,0x03,0x07,0x0C,0x08,0x00, | ||
0x06,0x06,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x0F,0x0C,0x0C,0x00,0x00, | ||
0xF0,0xF0,0x30,0xF0,0x30,0xF0,0xE0,0x00,0x0F,0x0F,0x00,0x01,0x00,0x0F,0x0F,0x00, | ||
0xF0,0xF0,0x30,0x30,0x30,0xF0,0xE0,0x00,0x0F,0x0F,0x00,0x00,0x00,0x0F,0x0F,0x00, | ||
0xC0,0xE0,0x30,0x30,0x30,0xE0,0xC0,0x00,0x03,0x07,0x0C,0x0C,0x0C,0x07,0x03,0x00, | ||
0xF0,0xF0,0x30,0x30,0xF0,0xC0,0x00,0x00,0x7F,0x7F,0x0C,0x0C,0x0F,0x07,0x00,0x00, | ||
0xC0,0xE0,0x30,0x30,0xF0,0xF0,0x00,0x00,0x07,0x0F,0x0C,0x0C,0x7F,0x7F,0x00,0x00, | ||
0xF0,0xF0,0x30,0x30,0x30,0x30,0x00,0x00,0x0F,0x0F,0x00,0x00,0x00,0x00,0x00,0x00, | ||
0xE0,0xF0,0xB0,0xB0,0x30,0x30,0x00,0x00,0x06,0x0C,0x0D,0x0D,0x0F,0x07,0x00,0x00, | ||
0x30,0x30,0xFC,0xFC,0x30,0x30,0x30,0x00,0x00,0x00,0x07,0x0F,0x0C,0x0C,0x0C,0x00, | ||
0xF0,0xF0,0x00,0x00,0x00,0xF0,0xF0,0x00,0x07,0x0F,0x0C,0x0C,0x0C,0x0F,0x0F,0x00, | ||
0x30,0xF0,0xC0,0x00,0xC0,0xF0,0x30,0x00,0x00,0x01,0x07,0x0E,0x07,0x01,0x00,0x00, | ||
0xF0,0xF0,0x00,0xC0,0xC0,0x00,0xF0,0xF0,0x01,0x0F,0x0F,0x01,0x01,0x0F,0x0F,0x01, | ||
0x10,0x30,0x70,0xE0,0xC0,0xF0,0x30,0x10,0x08,0x0C,0x0E,0x03,0x03,0x07,0x0E,0x08, | ||
0x00,0x30,0xF0,0xC0,0x00,0xC0,0xF0,0x30,0x60,0x60,0x61,0x77,0x3E,0x0F,0x01,0x00, | ||
0x30,0x30,0xB0,0xF0,0x70,0x30,0x00,0x00,0x0C,0x0E,0x0F,0x0C,0x0C,0x0C,0x00,0x00, | ||
0x80,0x80,0xFC,0x7E,0x06,0x06,0x00,0x00,0x01,0x01,0x3F,0x7E,0x60,0x60,0x00,0x00, | ||
0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x7F,0x00,0x00,0x00,0x00,0x00,0x00, | ||
0x06,0x06,0x7E,0xFC,0x80,0x80,0x00,0x00,0x60,0x60,0x7E,0x3F,0x01,0x01,0x00,0x00, | ||
0x80,0xC0,0xC0,0xC0,0x80,0xC0,0xC0,0x00,0x01,0x01,0x00,0x01,0x01,0x01,0x00,0x00 | ||
}; |