Skip to content
This repository has been archived by the owner on Feb 12, 2025. It is now read-only.

Commit

Permalink
Merge pull request #2 from rei-vilo/Release-8.0.0
Browse files Browse the repository at this point in the history
Release 8.0.1
  • Loading branch information
rei-vilo authored Apr 9, 2024
2 parents 9908ec9 + d82e072 commit 500ff5b
Show file tree
Hide file tree
Showing 37 changed files with 2,160 additions and 964 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ Hardware

## Licence

**Copyright** © Rei Vilo, 2010-2023
**Copyright** © Rei Vilo, 2010-2024

For exclusive use with Pervasive Displays screens

**Licence** [Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)](./LICENCE.md)

![](img/by-sa.svg)

**Portions** © Pervasive Displays, 2010-2024
41 changes: 21 additions & 20 deletions examples/Basic_Touch_Draw/Basic_Touch_Draw.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
/// @details Library for Pervasive Displays EXT3 - Basic level
///
/// @author Rei Vilo
/// @date 20 Mar 2023
/// @version 607
/// @date 21 Mar 2024
/// @version 801
///
/// @copyright (c) Rei Vilo, 2010-2023
/// @copyright (c) Rei Vilo, 2010-2024
/// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
/// @copyright For exclusive use with Pervasive Displays screens
///
/// @see ReadMe.txt for references
/// @n
Expand All @@ -36,10 +37,9 @@

// Define variables and constants

// === Pervasive Displays iTC
// --- Touch
// Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_EXT3_271_09_Touch, boardRaspberryPiPico_RP2040);
Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_EXT3_370_0C_Touch, boardRaspberryPiPico_RP2040);
// Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_271_KS_09_Touch, boardRaspberryPiPico_RP2040);
Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_370_PS_0C_Touch, boardRaspberryPiPico_RP2040);

// Prototypes

Expand All @@ -52,10 +52,10 @@ void wait(uint8_t second)
{
for (uint8_t i = second; i > 0; i--)
{
Serial.print(formatString(" > %i \r", i));
mySerial.print(formatString(" > %i \r", i));
delay(1000);
}
Serial.print(" \r");
mySerial.print(" \r");
}

#if (DISPLAY_TOUCH == 1)
Expand Down Expand Up @@ -90,7 +90,7 @@ void displayTouch(bool flag = true)
myScreen.circle(x, y, 4, myColours.black);
myScreen.flush();

Serial.print(-k);
mySerial.print(-k);
k--;
}

Expand Down Expand Up @@ -125,33 +125,34 @@ void displayTouch(bool flag = true)
void setup()
{
// Start
Serial.begin(115200);
// mySerial = Serial by default, otherwise edit hV_HAL_Peripherals.h
mySerial.begin(115200);
delay(500);
Serial.println();
Serial.println("=== " __FILE__);
Serial.println("=== " __DATE__ " " __TIME__);
Serial.println();
mySerial.println();
mySerial.println("=== " __FILE__);
mySerial.println("=== " __DATE__ " " __TIME__);
mySerial.println();

Serial.print("begin... ");
mySerial.print("begin... ");
myScreen.begin();
Serial.println(myScreen.WhoAmI());
mySerial.println(myScreen.WhoAmI());

myScreen.regenerate();

#if (DISPLAY_TOUCH == 1)

Serial.println("DISPLAY_TOUCH... ");
mySerial.println("DISPLAY_TOUCH... ");
myScreen.clear();
displayTouch();
wait(4);

#endif // DISPLAY_TOUCH

Serial.println("White... ");
mySerial.println("White... ");
myScreen.regenerate();

Serial.println("=== ");
Serial.println();
mySerial.println("=== ");
mySerial.println();
}

// Add loop code
Expand Down
52 changes: 28 additions & 24 deletions examples/Basic_Touch_GUI/Basic_Touch_GUI.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
/// @details Library for Pervasive Displays EXT3 - Basic edition
///
/// @author Rei Vilo
/// @date 25 Jan 2023
/// @version 605
/// @date 21 Mar 2024
/// @version 801
///
/// @copyright (c) Rei Vilo, 2010-2023
/// @copyright (c) Rei Vilo, 2010-2024
/// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
/// @copyright For exclusive use with Pervasive Displays screens
///
/// @see ReadMe.txt for references
/// @n
Expand All @@ -32,21 +33,23 @@
// Set parameters
#define DISPLAY_GUI 1

#if (SCREEN_EPD_EXT3_RELEASE < 531)
#error Required SCREEN_EPD_EXT3_RELEASE 531
#if (SCREEN_EPD_EXT3_RELEASE < 801)
#error Required SCREEN_EPD_EXT3_RELEASE 801
#endif SCREEN_EPD_EXT3_RELEASE

#include "hV_GUI.h"

#if (hV_GUI_BASIC_RELEASE < 605)
#error Required hV_GUI_BASIC_RELEASE 605
#if (hV_GUI_BASIC_RELEASE < 801)
#error Required hV_GUI_BASIC_RELEASE 801
#endif hV_GUI_BASIC_RELEASE

// Define structures and classes

// Define variables and constants
// Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_EXT3_271_09_Touch, boardRaspberryPiPico_RP2040);
Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_EXT3_370_0C_Touch, boardRaspberryPiPico_RP2040);

// --- Touch
// Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_271_KS_09_Touch, boardRaspberryPiPico_RP2040);
Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_370_PS_0C_Touch, boardRaspberryPiPico_RP2040);

uint8_t fontText;

Expand All @@ -61,10 +64,10 @@ void wait(uint8_t second)
{
for (uint8_t i = second; i > 0; i--)
{
Serial.print(formatString(" > %i \r", i));
mySerial.print(formatString(" > %i \r", i));
delay(1000);
}
Serial.print(" \r");
mySerial.print(" \r");
}

#if (DISPLAY_GUI == 1)
Expand Down Expand Up @@ -116,7 +119,7 @@ void displayGUI()
k -= 1;
chrono32 = millis() - chrono32;
myText.draw(formatString("%s in %i ms (%i left)", "Normal", chrono32, k));
Serial.println(formatString("%3i: %s in %i ms", k, "Normal", chrono32));
mySerial.println(formatString("%3i: %s in %i ms", k, "Normal", chrono32));
}

chrono32 = millis();
Expand All @@ -125,7 +128,7 @@ void displayGUI()
k -= 1;
chrono32 = millis() - chrono32;
myText.draw(formatString("%s in %i ms (%i left)", "Instant", chrono32, k));
Serial.println(formatString("%3i: %s in %i ms", k, "Instant", chrono32));
mySerial.println(formatString("%3i: %s in %i ms", k, "Instant", chrono32));
}
} // getTouchInterrupt

Expand All @@ -143,35 +146,36 @@ void displayGUI()
void setup()
{
// Start
Serial.begin(115200);
// mySerial = Serial by default, otherwise edit hV_HAL_Peripherals.h
mySerial.begin(115200);
delay(500);
Serial.println();
Serial.println("=== " __FILE__);
Serial.println("=== " __DATE__ " " __TIME__);
Serial.println();
mySerial.println();
mySerial.println("=== " __FILE__);
mySerial.println("=== " __DATE__ " " __TIME__);
mySerial.println();

Serial.print("begin... ");
mySerial.print("begin... ");
myScreen.begin();
Serial.println(myScreen.WhoAmI());
mySerial.println(myScreen.WhoAmI());

myScreen.regenerate();

fontText = Font_Terminal12x16;

#if (DISPLAY_GUI == 1)

Serial.println("DISPLAY_GUI... ");
mySerial.println("DISPLAY_GUI... ");
myScreen.clear();
displayGUI();
wait(4);

#endif // DISPLAY_GUI

Serial.println("White... ");
mySerial.println("White... ");
myScreen.regenerate();

Serial.println("=== ");
Serial.println();
mySerial.println("=== ");
mySerial.println();
}

// Add loop code
Expand Down
55 changes: 29 additions & 26 deletions examples/Basic_Touch_TicTacToe/Basic_Touch_TicTacToe.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
/// @details Library for Pervasive Displays EXT3 - Basic level
///
/// @author Rei Vilo
/// @date 20 Mar 2023
/// @version 607
/// @date 21 Mar 2024
/// @version 801
///
/// @copyright (c) Rei Vilo, 2010-2023
/// @copyright (c) Rei Vilo, 2010-2024
/// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
/// @copyright For exclusive use with Pervasive Displays screens
///
/// @see ReadMe.txt for references
/// @n
Expand Down Expand Up @@ -41,9 +42,10 @@
// Define variables and constants

// === Pervasive Displays iTC

// --- Touch
// Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_EXT3_271_09_Touch, boardRaspberryPiPico_RP2040);
Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_EXT3_370_0C_Touch, boardRaspberryPiPico_RP2040);
// Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_271_KS_09_Touch, boardRaspberryPiPico_RP2040);
Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_370_PS_0C_Touch, boardRaspberryPiPico_RP2040);

uint16_t x, y, dx, dy;

Expand Down Expand Up @@ -296,21 +298,21 @@ void playGame()
}
while ((winner == PLAYER_NONE) and (moves < NUMBER * NUMBER + 1));

Serial.print("--- ");
mySerial.print("--- ");
delay(100);
switch (winner)
{
case PLAYER_HUMAN:
Serial.println("HUMAN WINS");
mySerial.println("HUMAN WINS");

break;

case PLAYER_MCU:
Serial.println("MCU WINS");
mySerial.println("MCU WINS");
break;

default:
Serial.println("DRAW");
mySerial.println("DRAW");
break;
}
delay(100);
Expand All @@ -324,7 +326,7 @@ void moveHuman()
coordinates_s nextMove;
uint16_t ttx, tty, ttt;

Serial.println("--- PLAYER_HUMAN");
mySerial.println("--- PLAYER_HUMAN");

tt = TOUCH_EVENT_NONE;
ttt = TOUCH_EVENT_NONE;
Expand Down Expand Up @@ -357,20 +359,20 @@ void moveHuman()

void printBoard()
{
// Serial.println("Board:");
// mySerial.println("Board:");
for (uint8_t i = 0; i < NUMBER; i++)
{
Serial.print("[ ");
mySerial.print("[ ");
for (uint8_t j = 0; j < NUMBER; j++)
{
// Serial.print(board[i * 3 + j]);
Serial.print(board[j][i]);
Serial.print(" ");
// mySerial.print(board[i * 3 + j]);
mySerial.print(board[j][i]);
mySerial.print(" ");
}

Serial.println("]");
mySerial.println("]");
}
Serial.println("");
mySerial.println("");
}

bool checkHuman(coordinates_s & coordinates)
Expand Down Expand Up @@ -427,7 +429,7 @@ void moveMCU()
uint8_t counter = 0;
uint8_t movesPlayed = 0;
coordinates_s nextMove;
Serial.println("--- PLAYER_MCU");
mySerial.println("--- PLAYER_MCU");

// Four corners
uint8_t firstMovesI[4] = { 0, 0, NUMBER - 1, NUMBER - 1 };
Expand Down Expand Up @@ -749,16 +751,17 @@ uint8_t checkWinner()
void setup()
{
// Start
Serial.begin(115200);
// mySerial = Serial by default, otherwise edit hV_HAL_Peripherals.h
mySerial.begin(115200);
delay(500);
Serial.println();
Serial.println("=== " __FILE__);
Serial.println("=== " __DATE__ " " __TIME__);
Serial.println();
mySerial.println();
mySerial.println("=== " __FILE__);
mySerial.println("=== " __DATE__ " " __TIME__);
mySerial.println();

Serial.print("begin... ");
mySerial.print("begin... ");
myScreen.begin();
Serial.println(myScreen.WhoAmI());
mySerial.println(myScreen.WhoAmI());

myScreen.setOrientation(ORIENTATION_PORTRAIT);
myScreen.selectFont(Font_Terminal12x16);
Expand Down Expand Up @@ -801,7 +804,7 @@ void loop()

if (tt == TOUCH_EVENT_PRESS)
{
Serial.println("=== START");
mySerial.println("=== START");
myScreen.regenerate();
resetGame();
drawGameScreen();
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=PDLS_EXT3_Basic_Touch
version=7.0.2
version=8.0.1
author=Rei Vilo for Pervasive Displays
maintainer=Rei Vilo
sentence=Library for Pervasive Displays monochrome e-paper screens with touch and EXT3-1 + EXT3-Touch
Expand Down
Loading

0 comments on commit 500ff5b

Please sign in to comment.