sotsuron

Fork of linearMirrorMotion1017 by Hiromasa Oku

Committer:
takapiasano
Date:
Wed Jul 03 07:43:48 2013 +0000
Revision:
25:423050363215
Parent:
24:ab74d2018e6c
Child:
26:74ecbf9985e1
Tenmetsu for Saccade mirror

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hiromasaoku 16:6dd2e60bc5bc 1 #include "mbed.h"
hiromasaoku 16:6dd2e60bc5bc 2 #include <vector>
hiromasaoku 19:8e9fe7d25b9c 3 #define PI 3.14159
hiromasaoku 16:6dd2e60bc5bc 4
takapiasano 24:ab74d2018e6c 5 #define RENDER_INTERVAL 500// in microseconds
takapiasano 24:ab74d2018e6c 6 #define WAITING_FIRST 1 // this means WAITING_FIRST number of interrupt cycles in case of the first point
takapiasano 24:ab74d2018e6c 7 #define WAITING_LAST 1
takapiasano 24:ab74d2018e6c 8
takapiasano 24:ab74d2018e6c 9 enum stateMachine{NORMAL_POINT, FIRST_POINT, AFTER_LAST_POINT};
hiromasaoku 17:dce982e0a383 10
hiromasaoku 16:6dd2e60bc5bc 11 struct point2dl {
hiromasaoku 16:6dd2e60bc5bc 12 int x,y;
hiromasaoku 16:6dd2e60bc5bc 13 int laserSwitch; // laser {1: on 0:off} until next step
hiromasaoku 16:6dd2e60bc5bc 14 };
hiromasaoku 16:6dd2e60bc5bc 15
hiromasaoku 16:6dd2e60bc5bc 16 struct letter {
takapiasano 24:ab74d2018e6c 17 int pointnum; //not used for the time being
hiromasaoku 16:6dd2e60bc5bc 18 vector<point2dl> letpoints;
hiromasaoku 16:6dd2e60bc5bc 19 };
hiromasaoku 16:6dd2e60bc5bc 20
hiromasaoku 16:6dd2e60bc5bc 21 class render{
hiromasaoku 16:6dd2e60bc5bc 22 public:
hiromasaoku 16:6dd2e60bc5bc 23 void startRender();
hiromasaoku 16:6dd2e60bc5bc 24 void setRender(vector<letter> *p);
hiromasaoku 16:6dd2e60bc5bc 25 void translating(float speed, float angle);
hiromasaoku 16:6dd2e60bc5bc 26 void stopRender();
hiromasaoku 16:6dd2e60bc5bc 27 void draw();
hiromasaoku 18:6f86abfae754 28 void transform(point2dl& mypoint);
hiromasaoku 18:6f86abfae754 29 void shearing(point2dl& dataBefore);
hiromasaoku 18:6f86abfae754 30 void rotation(point2dl& dataBefore);
takapiasano 22:e86d63dfbbe1 31 void updateSpeed(float gspeed, float gangle, float vvx, float vvy);
hiromasaoku 20:8475768fc2f7 32
hiromasaoku 20:8475768fc2f7 33 int shearingSwitch;
takapiasano 25:423050363215 34 int laserColor;
hiromasaoku 18:6f86abfae754 35
hiromasaoku 16:6dd2e60bc5bc 36 private:
hiromasaoku 16:6dd2e60bc5bc 37 vector<letter> *ptext;
hiromasaoku 16:6dd2e60bc5bc 38 vector<letter> translated;
hiromasaoku 16:6dd2e60bc5bc 39 int currentLetters;
hiromasaoku 16:6dd2e60bc5bc 40 int currentPoints;
hiromasaoku 16:6dd2e60bc5bc 41 point2dl drawPoint;
hiromasaoku 17:dce982e0a383 42
takapiasano 24:ab74d2018e6c 43 stateMachine rendererState;
takapiasano 24:ab74d2018e6c 44 int firstPointCounter, lastPointCounter;
takapiasano 24:ab74d2018e6c 45
hiromasaoku 17:dce982e0a383 46 Ticker renderTimer;
hiromasaoku 20:8475768fc2f7 47 Timer speedTimer;
hiromasaoku 18:6f86abfae754 48
hiromasaoku 18:6f86abfae754 49 float speed;
hiromasaoku 18:6f86abfae754 50 float angle;
takapiasano 22:e86d63dfbbe1 51 float vx;
takapiasano 22:e86d63dfbbe1 52 float vy;
takapiasano 22:e86d63dfbbe1 53 int radious;
hiromasaoku 20:8475768fc2f7 54
hiromasaoku 16:6dd2e60bc5bc 55 };