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
Aim/Aim_test.h
- Committer:
- el18jgb
- Date:
- 2020-05-24
- Revision:
- 22:7406068f6c59
- Parent:
- 21:a0f3651f56c4
File content as of revision 22:7406068f6c59:
#ifndef AIM_TEST_H
#define AIM_TEST_H
/** Aim class Test
* @brief tests to do with the cursor
* @author Jospeh Body, University of Leeds
* @date May 2020
* @return true if test are passed
*/
bool Aim_test_initial()
{
// Initialise
Aim aim;
aim.init(); //_x = 42 _y = 5
// Read the position
Vector2D read_pos_1 = aim.get_pos();
printf("%f, %f\n", read_pos_1.x, read_pos_1.y);//aim pos has +2
// Now check that both the position is as expected
bool success_flag = true;
// Fail the test if the initial position is wrong
if (read_pos_1.x != 44 || read_pos_1.y != 7) {
success_flag = false;
}
return success_flag;
}
#endif