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.h
- Committer:
- el17m2h
- Date:
- 2019-05-08
- Revision:
- 23:9be87557b89a
- Parent:
- 22:0d2ac98a8b48
- Child:
- 24:67dc71a8f009
File content as of revision 23:9be87557b89a:
#ifndef DOODLER_H
#define DOODLER_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
class Doodler{
public:
Doodler();
~Doodler();
void init(float position_x, float position_y, double velocity_y);
void draw(N5110 &lcd);
void update(Direction d, float mag);
float get_velocity_x();
double get_velocity_y();
float get_position_x();
float get_position_y();
void set_velocity(float vel_x, double vel_y);
void set_position(float pos_x, float pos_y);
void check_rectangle();
void change_pos(Direction d, float mag);
void check_velocity();
private:
// since the velocity will be added, it will not be an integer so it cannot be a vector
float _position_x;
float _position_y;
// velocity needs to be float in order to decelerate
float _velocity_x;
double _velocity_y;
double _gravity;
double _up;
};
#endif