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.
Dependencies: mbed
Tests Class Reference
#include <Tests.h>
Public Member Functions | |
| Tests () | |
| Constructor. | |
| ~Tests () | |
| Destructor. | |
| void | init (int platforms_y) |
| Initalises the Tests. | |
| void | run_tests (float joy_x, float joy_y, Sprite_value sprite, int coin_x, int coin_y, int fire_y, int line_1_start, int line_2_start, int line_3_start, int line_length, N5110 &lcd) |
| Runs all the Tests with input stimulus. | |
Detailed Description
Tests Class.
Allows the user to input a set stimulus to test sprites by printing to LCD and terminal.
- Date:
- May 2019
#include "N5110.h" #include "Gamepad.h" #include "mbed.h" #include "Tests.h" N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); Gamepad gamepad; Tests test; // Create a test object if tests are to be done. void init_game(); int main() { init_game(); while(1) { lcd.setContrast(gamepad.read_pot()); // Contrast is controlled by pot. lcd.clear(); // Blelow line is an example of testing sprites. See documentation for // parameters and details. test.run_tests(1,1,Left,Skate_right,20,20,20,10,30,50,5,lcd); lcd.refresh(); wait(0.01); } } void init_game() { test.init(20); // Argument is the vertical position of test platforms. gamepad.init(); lcd.init(); lcd.normalMode(); lcd.setBrightness(0.5); }
Definition at line 54 of file Tests.h.
Constructor & Destructor Documentation
Member Function Documentation
| void init | ( | int | platforms_y ) |
| void run_tests | ( | float | joy_x, |
| float | joy_y, | ||
| Sprite_value | sprite, | ||
| int | coin_x, | ||
| int | coin_y, | ||
| int | fire_y, | ||
| int | line_1_start, | ||
| int | line_2_start, | ||
| int | line_3_start, | ||
| int | line_length, | ||
| N5110 & | lcd | ||
| ) |
Runs all the Tests with input stimulus.
- Parameters:
-
joy_x The x coordinate of the joystick joy_y The y coordinate of the joystick sprite the skateboarder sprite to be printed (from the enum class Sprite_value) coin_x The x coordinate of the coin coin_y The y coordinate of the coin fire_y The y coordinate of the fire line_1_start The starting x coordinate of line 1 line_2_start The starting x coordinate of line 2 line_3_start The starting x coordinate of line 3 line_length The length of each line in the platform object &lcd The lcd object from the N5110 class
Generated on Mon Jul 18 2022 14:06:02 by
1.7.2