Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "kinematics.h"
- #include <stdio.h>
- int FontSize = 1;
- double LL = 85;
- double readTaskSpace(Taskspace *t);
- double displayTaskSpace(Taskspace *t);
- double displayJointSpace(Jointspace *j);
- double displayRegisterSpace(Registerspace *r);
- void fonts(char l, Taskspace &input, Jointspace &OldAngles);
- int InverseKinematics(Taskspace t, Jointspace &j);
- int ForwardKinematics(Jointspace j, Taskspace &t);
- int MoveTo(Taskspace& Input, Jointspace& OldAngles);
- int JointToRegister(Jointspace j, Registerspace &r);
- int getDeltaTheta(Jointspace &Old, Jointspace &Delta);
- int getDeltaTask(Taskspace& prev, Taskspace& next);
- int LineTo(Taskspace& prev, Jointspace& old);
- bool queryUser();
- int getLength(Taskspace task);
- int spe = 230; // Motor speed; should not be higher than 240
- Microbot Mike;
- int main()
- {
- bool Continue = true;
- // Local variable of the microbot class
- Taskspace Input; // Local variable for input of coordinates
- Jointspace OldAngles;
- Taskspace HOME;
- HOME.x = 150;
- HOME.y = 0;
- HOME.z = 0;
- HOME.p = -1.5708;
- HOME.r = 0;
- HOME.g = 0;
- Taskspace STAR;
- STAR.x = 175;
- STAR.y = 200;
- STAR.z = 10;
- STAR.p = -1.5708;
- STAR.r = 0;
- STAR.g = 0;
- Taskspace PICKUP;
- PICKUP.x = 45;
- PICKUP.y = -280;
- PICKUP.z = 200;
- PICKUP.p = -1.5708;
- PICKUP.r = 0;
- PICKUP.g = 0;
- InverseKinematics(HOME, OldAngles);
- //robot.SendClose(230, 0);
- // sækja penna
- Input = PICKUP;
- MoveTo(Input, OldAngles);
- char x;
- scanf("%lf", &x);
- Input.z = 125;
- MoveTo(Input, OldAngles);
- scanf("%lf", &x);
- Mike.SendClose(230, 5);
- Input.g -= 25;
- MoveTo(Input, OldAngles);
- scanf("%lf", &x);
- Input.z += 150;
- MoveTo(Input, OldAngles);
- LL = 210;
- MoveTo(HOME, OldAngles);
- Input = HOME;
- scanf("%lf", &x);
- Input.z -= 15;
- MoveTo(Input, OldAngles);
- Input.g -= 50;
- MoveTo(Input, OldAngles);
- scanf("%lf", &x);
- Input.z += 10;
- MoveTo(Input, OldAngles);
- InverseKinematics(HOME, OldAngles);
- //byrjunarstaða
- Input = STAR;
- MoveTo(Input, OldAngles);
- while (Continue) {
- char str[10];
- printf("Enter a word:");
- scanf("%s", str);
- for (int i = 0; i < sizeof(str); i++) {
- fonts(str[i], Input, OldAngles);
- }
- Continue = queryUser();
- }
- MoveTo(HOME, OldAngles);
- Mike.SendClose(230, 0);
- }
- int MoveTo(Taskspace& Input, Jointspace& OldAngles) {
- Registerspace delta; // Local variable for input of motor steps
- Jointspace Angles;
- InverseKinematics(Input, Angles); // Get angles from those coordinates
- getDeltaTheta(OldAngles, Angles); // subtract them from the old angles
- JointToRegister(Angles, delta); // make the difference a registerspace
- Mike.SendStep(spe, delta);
- return 0;
- }
- bool queryUser() {
- char x;
- printf("\n \n Would you like to have another go? (y/Y for yes) ");
- scanf(" %c", &x);
- if (x == 'y') {
- return true;
- }
- else
- {
- return false;
- }
- }
- double readTaskSpace(Taskspace *t) {
- double x, y, z, p, r, g;
- printf("Please input taskspace parameters \n");
- printf("x:");
- scanf("%lf", &x);
- printf("y:");
- scanf("%lf", &y);
- printf("z:");
- scanf("%lf", &z);
- printf("p:");
- scanf("%lf", &p);
- printf("r:");
- scanf("%lf", &r);
- printf("g:");
- scanf("%lf", &g);
- t->x = x;
- t->y = -y;
- t->z = z;
- t->p = p * PI / 180;
- t->r = r * PI / 180;
- t->g = g;
- return 0;
- }
- double displayTaskSpace(Taskspace *t) {
- printf("\n These are the taskspace parameters \n");
- printf("x: %lf \n", t->x);
- printf("y: %lf \n", t->y);
- printf("z: %lf \n", t->z);
- printf("p: %lf \n", t->p);
- printf("r: %lf \n", t->r);
- printf("g: %lf \n", t->g);
- return 0;
- }
- double displayJointSpace(Jointspace *j) {
- printf("\n These are the jointspace parameters \n");
- printf("Theta 1: %lf \n", j->t[1]);
- printf("Theta 2: %lf \n", j->t[2]);
- printf("Theta 3: %lf \n", j->t[3]);
- printf("Theta 4: %lf \n", j->t[4]);
- printf("Theta 5: %lf \n", j->t[5]);
- return 0;
- }
- double displayRegisterSpace(Registerspace *r) {
- printf("\n These are the register parameters \n");
- printf("R 1: %i \n", r->r[1]);
- printf("R 2: %i \n", r->r[2]);
- printf("R 3: %i \n", r->r[3]);
- printf("R 4: %i \n", r->r[4]);
- printf("R 5: %i \n", r->r[5]);
- printf("R 6: %i \n", r->r[6]);
- return 0;
- }
- int InverseKinematics(Taskspace t, Jointspace &j) {
- j.t[1] = atan2(t.y, t.x);
- double RR = sqrt(t.x * t.x + t.y * t.y);
- j.t[5] = t.p + t.r + R1 * j.t[1]; // kanski breyta gildi r1
- j.t[4] = t.p - t.r - R1 * j.t[1]; // kanski breyta gildi r1
- double R0 = RR - LL * cos(t.p);
- double Z0 = t.z - LL * sin(t.p) - H;
- double beta = atan2(Z0, R0);
- double alpha = atan(sqrt((4.0 * L * L) / (((R0 * R0) + (Z0 * Z0))) - 1.0));
- j.t[2] = beta + alpha;
- j.t[3] = beta - alpha;
- j.t[6] = t.g;
- return 0;
- }
- int ForwardKinematics(Jointspace j, Taskspace &t) {
- t.p = (j.t[5] + j.t[4]) / 2;
- t.r = (j.t[5] - j.t[4]) / 2;
- double RR = L * cos(j.t[2]) + L * cos(j.t[3]) + LL * cos(t.p);
- t.x = RR * cos(j.t[1]);
- t.y = RR * sin(j.t[1]);
- t.z = H + L * sin(j.t[2]) + L * sin(j.t[3]) + LL * sin(t.p);
- return 0;
- }
- int JointToRegister(Jointspace j, Registerspace &r) {
- r.r[1] = (int)(j.t[1] * 1125);
- r.r[2] = (int)(j.t[2] * 1125);
- r.r[3] = (int)(j.t[3] * 661.2);
- r.r[4] = (int)(j.t[4] * 241);
- r.r[5] = (int)(j.t[5] * 241);
- r.r[6] = (int)(j.t[6] * 14.6 + r.r[3]);
- return 0;
- }
- int getDeltaTheta(Jointspace &Old, Jointspace &Delta) {
- for (int i = 1; i < 6; i++)
- {
- Delta.t[i] = Old.t[i] - Delta.t[i];
- Old.t[i] = Old.t[i] - Delta.t[i];
- }
- return 0;
- }
- // next becomes delta and prev becomes next
- int getDeltaTask(Taskspace &Prev, Taskspace &Next) {
- Next.x = Prev.x - Next.x;
- Prev.x = Prev.x - Next.x;
- Next.y = Prev.y - Next.y;
- Prev.y = Prev.y - Next.y;
- Next.z = Prev.z - Next.z;
- Prev.z = Prev.z - Next.z;
- Next.p = Prev.p - Next.p;
- Prev.p = Prev.p - Next.p;
- Next.r = Prev.r - Next.r;
- Prev.r = Prev.r - Next.r;
- Next.g = Prev.g - Next.g;
- Prev.g = Prev.g - Next.g;
- return 0;
- }
- int getLength(Taskspace task) {
- return (int)((task.x)*(task.x) + (task.y)*(task.y) + (task.z)*(task.z));
- }
- // inc will include the length of each increment in each direction
- // next will be empty
- int getIncrements(Taskspace& Next, Taskspace& inc, int div) {
- inc.x = Next.x / div;
- inc.y = Next.y / div;
- inc.z = Next.z / div;
- inc.p = Next.p / div;
- inc.r = Next.r / div;
- inc.g = Next.g / div;
- return 0;
- }
- int incementNext(Taskspace& curr, Taskspace& inc) {
- curr.x = curr.x + inc.x;
- curr.y = curr.y + inc.y;
- curr.z = curr.z + inc.z;
- curr.p = curr.p + inc.p;
- curr.r = curr.r + inc.r;
- curr.g = curr.g + inc.g;
- return 0;
- }
- int LineTo(Taskspace &next, Jointspace& OldAngles) {
- Taskspace curr;
- ForwardKinematics(OldAngles, curr);
- Taskspace end = curr; // current er alltaf núverandi staðsetning á eftir verður end svo lokastaðsetning
- Taskspace inc; // inc er hversu langt hvert stökk er
- getDeltaTask(end, next); // end er loka staðsetningin og delta er heildar lengdin
- int s = getLength(next) / 25; // s er fjöldi skrefa sem þarf að taka -1
- if (s == 0) { // það þarf bara að taka eitt skref, er það einfaldlega tekið
- MoveTo(end, OldAngles); // þarf kanski að spá í því hvað er að gerast við þessi taskspace (þarf að nota það?)
- return 0;
- }
- getIncrements(next, inc, s); // bý til inc sem heldur utanum lengd hvers stökks í hverja átt fyrir sig
- for (; s < 0; s--) // tek S mörg stökk sem eru inc á lengd hvert um sig.
- {
- MoveTo(curr, OldAngles);
- }
- MoveTo(end, OldAngles); // síðasta stökkið fer alltaf á end
- }
- void fonts(char l, Taskspace &Input, Jointspace &OldAngles) {
- if (l == 'a') {
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x += 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y += 25;
- MoveTo(Input, OldAngles);
- }
- //Next letter
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.x += 25;
- Input.y -= 50;
- MoveTo(Input, OldAngles);
- }
- }
- else if ( l == 'b') {
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 25;
- Input.x += 12.5;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y += 25;
- Input.x += 12.5;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 25;
- Input.x += 12.5;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y += 25;
- Input.x += 12.5;
- MoveTo(Input, OldAngles);
- }
- //Next letter
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.y -= 50;
- MoveTo(Input, OldAngles);
- }
- }
- else if (l == 'c') {
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x -= 12.5;
- Input.y += 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 25;
- Input.x -= 12.5;
- MoveTo(Input, OldAngles);
- }
- //Next letter
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.y -= 25;
- Input.x += 50;
- MoveTo(Input, OldAngles);
- }
- }
- else if (l == 'd') {
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x += 25;
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x += 25;
- Input.y += 25;
- MoveTo(Input, OldAngles);
- }
- //Next letter
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.y -= 50;
- MoveTo(Input, OldAngles);
- }
- }
- else if (l == 'e') {
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x += 25;
- Input.y += 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 12.5;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x += 25;
- Input.y += 12.5;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z -= 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- //Next letter
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- }
- else if (l == 'f') {
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x += 25;
- Input.y += 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 12.5;
- MoveTo(Input, OldAngles);
- }
- //Next letter
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.y -= 37.5;
- Input.x += 25;
- MoveTo(Input, OldAngles);
- }
- }
- else if (l == 'g') {
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x += 50;
- Input.y += 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y += 12.5;
- MoveTo(Input, OldAngles);
- }
- //Next letter
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.y -= 37.5;
- Input.x += 25;
- MoveTo(Input, OldAngles);
- }
- }
- else if (l == 'h') {
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x += 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x += 25;
- MoveTo(Input, OldAngles);
- }
- //Next letter
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- }
- else if (l == 'i') {
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y += 12.5;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x += 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y += 12.5;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- //Next letter
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- }
- else if (l == 'j') {
- for (int i = 0; i < FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x += 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- //Next letter
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.y -= 25;
- Input.x += 50;
- MoveTo(Input, OldAngles);
- }
- }
- else if (l == 'k') {
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x += 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x -= 25;
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x += 25;
- Input.y += 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x += 25;
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- //Next letter
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- }
- else if (l == 'l') {
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x += 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- //Next letter
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- }
- else if (l == 'm') {
- for (int i = 0; i < 1; i++)
- {
- Input.z = 0;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 2 * FontSize; i++)
- {
- Input.x -= 25;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x += 25;
- Input.y -= 12.5;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < FontSize; i++)
- {
- Input.x -= 25;
- Input.y -= 12.5;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 2*FontSize; i++)
- {
- Input.x += 25;
- MoveTo(Input, OldAngles);
- }
- //Next letter
- for (int i = 0; i < 1; i++)
- {
- Input.z = 10;
- MoveTo(Input, OldAngles);
- }
- for (int i = 0; i < 1; i++)
- {
- Input.y -= 25;
- MoveTo(Input, OldAngles);
- }
- }
- else if (l == 'n') {
- printf("I want to draw N \n");
- }
- else if (l == 'o') {
- printf("I want to draw O \n");
- }
- else if (l == 'p') {
- printf("I want to draw P \n");
- }
- else if (l == 'q') {
- printf("I want to draw Q \n");
- }
- else if (l == 'r') {
- printf("I want to draw R \n");
- }
- else if (l == 's') {
- printf("I want to draw S \n");
- }
- else if (l == 't') {
- printf("I want to draw T \n");
- }
- else if (l == 'u') {
- printf("I want to draw U \n");
- }
- else if (l == 'v') {
- printf("I want to draw V \n");
- }
- else if (l == 'W') {
- printf("I want to draw V \n");
- }
- else if (l == 'X') {
- printf("I want to draw X \n");
- }
- else if (l == 'y') {
- printf("I want to draw Y \n");
- }
- else if (l == 'z') {
- printf("I want to draw z \n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement