Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Paddle Class Reference
This library has been made to allow the paddle to update, check its position .etc This will make the coding later on in the main file a bit easier to manipulate. More...
#include <Paddle.h>
Public Member Functions | |
| Paddle (int x_1, int x_2, int y_1, int y_2) | |
| The following show the connections to the K64F. | |
| int | lookforX1 () |
| Checks to see what pixels are on in the X coordinate for player 1 and returns a value for X1. | |
| int | lookforX2 () |
| Allows to check to see what pixels are on in the X coordinate for player 2 and returns a value for X2. | |
| int | lookforY1 () |
| Checks to see what pixels are on in the Y coordinate for player 1 and returns a value for Y1 . | |
| int | lookforY2 () |
| Check to see what pixels are on in the Y coordinate for player 2 and returns a value for Y2. | |
| void | YPaddle (N5110 &display) |
| Once the coordinates have been obtained it will display them on the lcd. | |
| void | Moving_Paddle (N5110 &display) |
| Once the coordinates have been obtained it will update the display when the paddle moves. | |
| void | Refresh_pos (AnalogIn &p1) |
| This function allow me to refresh the position of Player 1. | |
Detailed Description
This library has been made to allow the paddle to update, check its position .etc This will make the coding later on in the main file a bit easier to manipulate.
Revision 1.0
- Date:
- April 2016
Definition at line 22 of file Paddle.h.
Constructor & Destructor Documentation
| Paddle | ( | int | x_1, |
| int | x_2, | ||
| int | y_1, | ||
| int | y_2 | ||
| ) |
Member Function Documentation
| int lookforX1 | ( | ) |
Checks to see what pixels are on in the X coordinate for player 1 and returns a value for X1.
Definition at line 12 of file Paddle.cpp.
| int lookforX2 | ( | ) |
Allows to check to see what pixels are on in the X coordinate for player 2 and returns a value for X2.
Definition at line 17 of file Paddle.cpp.
| int lookforY1 | ( | ) |
Checks to see what pixels are on in the Y coordinate for player 1 and returns a value for Y1 .
Definition at line 22 of file Paddle.cpp.
| int lookforY2 | ( | ) |
Check to see what pixels are on in the Y coordinate for player 2 and returns a value for Y2.
Definition at line 27 of file Paddle.cpp.
| void Moving_Paddle | ( | N5110 & | display ) |
Once the coordinates have been obtained it will update the display when the paddle moves.
Definition at line 43 of file Paddle.cpp.
| void Refresh_pos | ( | AnalogIn & | p1 ) |
This function allow me to refresh the position of Player 1.
| void YPaddle | ( | N5110 & | display ) |
Once the coordinates have been obtained it will display them on the lcd.
for(int i = y1; i <= y2; i++) { display.setPixel(x1, i); display.setPixel(x2, i); }
display.refresh(); }
Definition at line 32 of file Paddle.cpp.
Generated on Thu Jul 21 2022 10:50:37 by
1.7.2