Pervasive Displays Library Suite - Reference Manual 9.0.3
Library for Pervasive Displays e-paper screens, extension boards and development kits
Loading...
Searching...
No Matches
Touch_TicTacToe.ino File Reference

Example of features for basic edition. More...

#include "PDLS_Common.h"
#include "Pervasive_Touch_Small.h"
#include "PDLS_Advanced.h"
Include dependency graph for Touch_TicTacToe.ino:

Classes

struct  coordinates_s
 

Functions

bool checkWinnerPlayer (uint8_t player)
 Check whether palyer is winner.
 
void drawWinnerPlayer (uint8_t player)
 Draw winning line, column or diagonal.
 
uint8_t checkWinner ()
 Check the winner.
 
void drawMovePlayer (coordinates_s coordinates, uint8_t player)
 Display the move of player.
 
void moveMCU ()
 Let the MCU play.
 
bool checkHuman (coordinates_s &coordinates)
 Check human play.
 
void printBoard ()
 Print board on serial.
 
void playGame ()
 Play the game.
 
void moveHuman ()
 Let the human play.
 
void resetGame ()
 Reset the game.
 
void drawStartScreen ()
 Draw start screen.
 
void drawGameScreen ()
 Draw empty board.
 
void drawGameOverScreen ()
 Draw end of game.
 
uint8_t getBoard (coordinates_s coordinates)
 Get board cell content.
 
bool setBoard (coordinates_s coordinates, uint8_t player)
 Set board cell content to player.
 
void displayCenteredText (uint16_t x0, uint16_t y0, STRING_CONST_TYPE text, uint16_t colour)
 Display text centered on coordinates.
 
void setup ()
 Setup.
 
void loop ()
 Loop, empty.
 

Detailed Description

Example of features for basic edition.

Project Pervasive Displays Library Suite
Based on highView technology

Author
Rei Vilo
Date
21 Jan 2025
Version
902
  • Basic edition: for hobbyists and for basic usage
    Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
  • Evaluation edition: for professionals or organisations, no commercial usage
    All rights reserved
  • Commercial edition: for professionals or organisations, commercial usage
    All rights reserved

Function Documentation

◆ checkHuman()

bool checkHuman ( coordinates_s & coordinates)

Check human play.

Parameters
coordinatescoordinates of the cell to block
Returns
true if cell identified, false otherwise

◆ checkWinner()

uint8_t checkWinner ( )

Check the winner.

Returns
winner player number, 0 if none

◆ checkWinnerPlayer()

bool checkWinnerPlayer ( uint8_t player)

Check whether palyer is winner.

Parameters
playerplayer number
Returns
true if winner, false otherwise

◆ displayCenteredText()

void displayCenteredText ( uint16_t x0,
uint16_t y0,
STRING_CONST_TYPE text,
uint16_t colour )

Display text centered on coordinates.

Parameters
x0x coordinate
y0y coordinate
texttext
colourcolour

◆ drawMovePlayer()

void drawMovePlayer ( coordinates_s coordinates,
uint8_t player )

Display the move of player.

Parameters
coordinatesmove coordinates
playerplayer number

◆ drawWinnerPlayer()

void drawWinnerPlayer ( uint8_t player)

Draw winning line, column or diagonal.

Parameters
playerplayer number

◆ getBoard()

uint8_t getBoard ( coordinates_s coordinates)

Get board cell content.

Parameters
coordinatescoordinates i j of cell
Returns
player number

◆ setBoard()

bool setBoard ( coordinates_s coordinates,
uint8_t player )

Set board cell content to player.

Parameters
coordinatescoordinates i j of cell
playerplayer number
Returns
true is cell updated, false otherwise
Note
Targeted cell should be empty