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
Diff: ReflectionPaddle/RePaddle.cpp
- Revision:
- 12:2af7b4868033
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ReflectionPaddle/RePaddle.cpp Wed May 27 07:00:37 2020 +0000
@@ -0,0 +1,35 @@
+
+#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;
+}
\ No newline at end of file