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
Doodler/Doodler.cpp
- Committer:
- el17m2h
- Date:
- 2019-04-11
- Revision:
- 4:8ec314f806ae
- Child:
- 5:8814d6de77d0
File content as of revision 4:8ec314f806ae:
#include "Doodler.h" Doodler::Doodler(){ } Doodler::~Doodler(){ } void Doodler::init(int x, int y, int radius){ _radius = radius; _x = x; _y = y; _velocity.x = 0; _velocity.y = 0; } void Doodler::draw(N5110 &lcd){ lcd.drawCircle(_x, _y, _radius, FILL_BLACK); } void Doodler::set_velocity(Vector2D v){ _velocity.x = v.x; _velocity.y = v.y; } Vector2D Doodler::get_velocity(){ Vector2D v = {_velocity.x,_velocity.y}; return v; } Vector2D Doodler::get_pos(){ Vector2D p = {_x,_y}; return p; } void Doodler::set_pos(Vector2D p){ _x = p.x; _y = p.y; }