-
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.
- Loading branch information
Showing
16 changed files
with
1,299 additions
and
32 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -3,3 +3,4 @@ Doxyfile | |
docs/ | ||
latex/ | ||
xml/ | ||
img/ |
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
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,186 @@ | ||
/// | ||
/// @file Common_Palette.ino | ||
/// @brief Example of features for basic edition | ||
/// | ||
/// @details Project Pervasive Displays Library Suite | ||
/// @n Based on highView technology | ||
/// | ||
/// @author Rei Vilo | ||
/// @date 16 Aug 2021 | ||
/// @version 508 | ||
/// | ||
/// @copyright (c) Rei Vilo, 2010-2022 | ||
/// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) | ||
/// | ||
/// @see ReadMe.txt for references | ||
/// @n | ||
/// | ||
|
||
// SDK | ||
#if defined(ENERGIA) // LaunchPad specific | ||
#include "Energia.h" | ||
#else // Arduino general | ||
#include "Arduino.h" | ||
#endif // end IDE | ||
|
||
// Set parameters | ||
|
||
// Include application, user and local libraries | ||
#include "SPI.h" | ||
#include "PDLS_EXT3_Basic.h" | ||
|
||
// Define structures and classes | ||
|
||
// Define variables and constants | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_154, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_213, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_266, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_271, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_287, boardLaunchPad); | ||
Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_370, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_417, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_437, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_565, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_581, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_741, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_969, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_B98, boardLaunchPad); | ||
|
||
// Prototypes | ||
|
||
// Utilities | ||
/// | ||
/// @brief Wait with countdown | ||
/// @param second duration, s | ||
/// | ||
void wait(uint8_t second) | ||
{ | ||
for (uint8_t i = second; i > 0; i--) | ||
{ | ||
Serial.print(formatString(" > %i \r", i)); | ||
delay(1000); | ||
} | ||
Serial.print(" \r"); | ||
} | ||
|
||
|
||
// Functions | ||
/// | ||
/// @brief Palette test screen | ||
/// @param flag true = default = perform flush, otherwise no | ||
/// | ||
/// @image html T2_PALET.jpg | ||
/// @image latex T2_PALET.PDF width=10cm | ||
/// | ||
void displayPalette(bool flag = true) | ||
{ | ||
myScreen.setOrientation(7); | ||
|
||
uint16_t x0, y0, dx, dy, maxSize, colour; | ||
maxSize = min((myScreen.screenSizeX() * 10 / 50), (myScreen.screenSizeY() * 10 / 35)); | ||
dx = (myScreen.screenSizeX() - maxSize * 50 / 10) / 2; | ||
dy = (myScreen.screenSizeY() - maxSize * 35 / 10) / 2; | ||
|
||
y0 = dy + maxSize / 2; | ||
x0 = dx + maxSize / 2; | ||
myScreen.dRectangle(x0 - 2, y0 - 2, maxSize + 4, maxSize + 4, myColours.red); | ||
x0 = dx + maxSize * 4 / 2; | ||
myScreen.dRectangle(x0 - 2, y0 - 2, maxSize + 4, maxSize + 4, myColours.red); | ||
x0 = dx + maxSize * 7 / 2; | ||
myScreen.dRectangle(x0 - 2, y0 - 2, maxSize + 4, maxSize + 4, myColours.red); | ||
|
||
y0 = dy + maxSize * 4 / 2; | ||
x0 = dx + maxSize / 2; | ||
myScreen.dRectangle(x0 - 2, y0 - 2, maxSize + 4, maxSize + 4, myColours.black); | ||
x0 = dx + maxSize * 4 / 2; | ||
myScreen.dRectangle(x0 - 2, y0 - 2, maxSize + 4, maxSize + 4, myColours.black); | ||
x0 = dx + maxSize * 7 / 2; | ||
myScreen.dRectangle(x0 - 2, y0 - 2, maxSize + 4, maxSize + 4, myColours.black); | ||
|
||
myScreen.setPenSolid(); | ||
myScreen.selectFont(Font_Terminal6x8); | ||
|
||
x0 = dx + maxSize / 2; | ||
y0 = dy + maxSize / 2; | ||
// Light red | ||
myScreen.dRectangle(x0, y0, maxSize, maxSize, myColours.lightRed); | ||
myScreen.gText(x0, y0 + maxSize + 6, "light", myColours.red); | ||
|
||
x0 = dx + maxSize * 4 / 2; | ||
y0 = dy + maxSize / 2; | ||
// Red | ||
myScreen.dRectangle(x0, y0, maxSize, maxSize, myColours.red); | ||
myScreen.gText(x0, y0 + maxSize + 6, "red", myColours.red); | ||
|
||
x0 = dx + maxSize * 7 / 2; | ||
y0 = dy + maxSize / 2; | ||
// Dark-red | ||
myScreen.dRectangle(x0, y0, maxSize, maxSize, myColours.darkRed); | ||
myScreen.gText(x0, y0 + maxSize + 6, "dark", myColours.red); | ||
|
||
x0 = dx + maxSize / 2; | ||
y0 = dy + maxSize * 4 / 2; | ||
// White | ||
myScreen.dRectangle(x0, y0, maxSize, maxSize, myColours.white); | ||
myScreen.gText(x0, y0 + maxSize + 6, "white", myColours.black); | ||
|
||
x0 = dx + maxSize * 4 / 2; | ||
y0 = dy + maxSize * 4 / 2; | ||
// Grey | ||
myScreen.dRectangle(x0, y0, maxSize, maxSize, myColours.grey); | ||
myScreen.gText(x0, y0 + maxSize + 6, "grey", myColours.black); | ||
|
||
x0 = dx + maxSize * 7 / 2; | ||
y0 = dy + maxSize * 4 / 2; | ||
// Black | ||
myScreen.dRectangle(x0, y0, maxSize, maxSize, myColours.black); | ||
myScreen.gText(x0, y0 + maxSize + 6, "black", myColours.black); | ||
|
||
myScreen.selectFont(Font_Terminal8x12); | ||
myScreen.gText(0, 0, myScreen.WhoAmI(), myColours.black); | ||
|
||
myScreen.flush(); | ||
} | ||
|
||
// Add setup code | ||
/// | ||
/// @brief Setup | ||
/// | ||
void setup() | ||
{ | ||
Serial.begin(115200); | ||
delay(500); | ||
Serial.println(); | ||
Serial.println("=== " __FILE__); | ||
Serial.println("=== " __DATE__ " " __TIME__); | ||
Serial.println(); | ||
|
||
Serial.print("begin... "); | ||
myScreen.begin(); | ||
Serial.println(formatString("%s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); | ||
|
||
Serial.print("Palettes... "); | ||
myScreen.clear(); | ||
displayPalette(); | ||
wait(8); | ||
|
||
Serial.print("White... "); | ||
myScreen.clear(); | ||
myScreen.flush(); | ||
|
||
Serial.println("=== "); | ||
Serial.println(); | ||
|
||
#if defined(ARDUINO_ARCH_PIDUINO) | ||
exit(0); | ||
#endif | ||
} | ||
|
||
// Add loop code | ||
/// | ||
/// @brief Loop, empty | ||
/// | ||
void loop() | ||
{ | ||
delay(1000); | ||
} |
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,157 @@ | ||
/// | ||
/// @file Common_Palette.ino | ||
/// @brief Example of features for basic edition | ||
/// | ||
/// @details Project Pervasive Displays Library Suite | ||
/// @n Based on highView technology | ||
/// | ||
/// @author Rei Vilo | ||
/// @date 16 Aug 2021 | ||
/// @version 508 | ||
/// | ||
/// @copyright (c) Rei Vilo, 2010-2022 | ||
/// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) | ||
/// | ||
/// @see ReadMe.txt for references | ||
/// @n | ||
/// | ||
|
||
// SDK | ||
#if defined(ENERGIA) // LaunchPad specific | ||
#include "Energia.h" | ||
#else // Arduino general | ||
#include "Arduino.h" | ||
#endif // end IDE | ||
|
||
// Set parameters | ||
|
||
// Include application, user and local libraries | ||
#include "SPI.h" | ||
#include "PDLS_EXT3_Basic.h" | ||
|
||
// Define structures and classes | ||
|
||
// Define variables and constants | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_154, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_213, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_266, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_271, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_287, boardLaunchPad); | ||
Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_370, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_417, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_437, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_565, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_581, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_741, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_969, boardLaunchPad); | ||
// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_B98, boardLaunchPad); | ||
|
||
// Prototypes | ||
|
||
// Utilities | ||
/// | ||
/// @brief Wait with countdown | ||
/// @param second duration, s | ||
/// | ||
void wait(uint8_t second) | ||
{ | ||
for (uint8_t i = second; i > 0; i--) | ||
{ | ||
Serial.print(formatString(" > %i \r", i)); | ||
delay(1000); | ||
} | ||
Serial.print(" \r"); | ||
} | ||
|
||
|
||
// Functions | ||
/// | ||
/// @brief Fonts test screen | ||
/// @param flag true = default = perform flush, otherwise no | ||
/// | ||
/// @image html T2_FONTS..jpg | ||
/// @image latex T2_FONTS.PDF width=10cm | ||
/// | ||
void displayFonts(bool flag = true) | ||
{ | ||
uint16_t y = 10; | ||
myScreen.setOrientation(7); | ||
|
||
// #if (USE_FONT_MODE == USE_FONT_TERMINAL) | ||
myScreen.selectFont(Font_Terminal12x16); | ||
|
||
myScreen.gText(10, y, myScreen.WhoAmI(), myColours.red); | ||
y += myScreen.characterSizeY(); | ||
myScreen.gText(10, y, formatString("%i x %i", myScreen.screenSizeX(), myScreen.screenSizeY()), myColours.red); | ||
y += myScreen.characterSizeY(); | ||
y += myScreen.characterSizeY(); | ||
|
||
myScreen.selectFont(Font_Terminal6x8); | ||
myScreen.gText(10, y, "Terminal6x8"); | ||
y += myScreen.characterSizeY(); | ||
|
||
myScreen.selectFont(Font_Terminal8x12); | ||
myScreen.gText(10, y, "Terminal8x12"); | ||
y += myScreen.characterSizeY(); | ||
|
||
myScreen.selectFont(Font_Terminal12x16); | ||
myScreen.gText(10, y, "Terminal12x16"); | ||
y += myScreen.characterSizeY(); | ||
|
||
myScreen.selectFont(Font_Terminal16x24); | ||
myScreen.gText(10, y, "Terminal16x24"); | ||
y += myScreen.characterSizeY(); | ||
|
||
// #elif (USE_FONT_MODE == USE_FONT_HEADER) | ||
// | ||
// #elif (USE_FONT_MODE == USE_FONT_FLASH) | ||
// | ||
// #else | ||
// #error USE_FONT_MODE not defined | ||
// #endif | ||
|
||
myScreen.flush(); | ||
} | ||
|
||
// Add setup code | ||
/// | ||
/// @brief Setup | ||
/// | ||
void setup() | ||
{ | ||
Serial.begin(115200); | ||
delay(500); | ||
Serial.println(); | ||
Serial.println("=== " __FILE__); | ||
Serial.println("=== " __DATE__ " " __TIME__); | ||
Serial.println(); | ||
|
||
Serial.print("begin... "); | ||
myScreen.begin(); | ||
Serial.println(formatString("%s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); | ||
|
||
Serial.print("Fonts... "); | ||
myScreen.clear(); | ||
displayFonts(); | ||
wait(8); | ||
|
||
Serial.print("White... "); | ||
myScreen.clear(); | ||
myScreen.flush(); | ||
|
||
Serial.println("=== "); | ||
Serial.println(); | ||
|
||
#if defined(ARDUINO_ARCH_PIDUINO) | ||
exit(0); | ||
#endif | ||
} | ||
|
||
// Add loop code | ||
/// | ||
/// @brief Loop, empty | ||
/// | ||
void loop() | ||
{ | ||
delay(1000); | ||
} |
Oops, something went wrong.