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
ReflectionPaddle/RePaddle.cpp
- Committer:
- Mousky
- Date:
- 2020-05-27
- Revision:
- 12:2af7b4868033
File content as of revision 12:2af7b4868033:
#include "RePaddle.h"
//create fixed reflection borad
RePaddle::RePaddle()
{
}
RePaddle::~RePaddle()
{
}
void RePaddle::init(int size)
{
_size = size;
_x = 22;
_y = 15;
srand(time(NULL));
}
void RePaddle::draw(N5110 &lcd)
{
lcd.drawRect(_x,_y,_size,1,FILL_BLACK);
}
Vector2D RePaddle::get_pos()
{
Vector2D p = {_x,_y};
return p;
}
void RePaddle::set_pos(Vector2D p)
{
_x = p.x;
_y = p.y;
}