Thomas Morris / Mbed OS PROJ324_Final

Fork of ELEC351_Group_T by Plymouth ELEC351 Group T

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MOVES.cpp Source File

MOVES.cpp

00001 //This is where the algorithms movements will be defined
00002 #include "MOVES.hpp"
00003 
00004 int side = 0; //Sides
00005 void List_Execution()
00006 {
00007     pc.printf("Move point value is : %d\n",Move_list_pointer);
00008     for(int i = 0; i<= Move_list_pointer; i += 1)
00009     {
00010         if(Move_list[i] == 0){pc.printf("Move List Finished\n");}
00011         else if (Move_list[i] == 1){STEPPER_MOTOR_1.Rotate_Steps(50 ,1);}
00012         else if (Move_list[i] == 2){STEPPER_MOTOR_1.Rotate_Steps(50 ,0);}  
00013         else if (Move_list[i] == 3){STEPPER_MOTOR_2.Rotate_Steps(50 ,1);}  
00014         else if (Move_list[i] == 4){STEPPER_MOTOR_2.Rotate_Steps(50 ,0);}  
00015         else if (Move_list[i] == 5){STEPPER_MOTOR_3.Rotate_Steps(50 ,1);}  
00016         else if (Move_list[i] == 6){STEPPER_MOTOR_3.Rotate_Steps(50 ,0);}  
00017         else if (Move_list[i] == 7){STEPPER_MOTOR_4.Rotate_Steps(50 ,1);}  
00018         else if (Move_list[i] == 8){STEPPER_MOTOR_4.Rotate_Steps(50 ,0);}  
00019         else if (Move_list[i] == 9){STEPPER_MOTOR_5.Rotate_Steps(50 ,1);}  
00020         else if (Move_list[i] == 10){STEPPER_MOTOR_5.Rotate_Steps(50 ,0);}  
00021         else if (Move_list[i] == 11){STEPPER_MOTOR_6.Rotate_Steps(50 ,1);}  
00022         else if (Move_list[i] == 12){STEPPER_MOTOR_6.Rotate_Steps(50 ,0);}  
00023         else pc.printf("Finished\n");   
00024     }
00025     pc.printf("List Run sucessful\n");
00026 }
00027 void White_Cross()
00028 {
00029     
00030 }
00031 
00032 
00033 void White_Cross_Position()
00034 {
00035     if(CubeMap[1][0][1] == White )//Top middle
00036     {
00037         //rotate 180
00038     }
00039     if(CubeMap[1][1][0] == White )//Middle Left
00040     {
00041         //rotate 90
00042     }
00043     if(CubeMap[1][1][2] == White )//Middle Right
00044     {
00045         //rotate 0
00046     }
00047     if(CubeMap[1][2][1] == White )//Bottom Middle
00048     {
00049         //rotate 270
00050     }
00051 }
00052 void White_Cross_Orientate()
00053 {
00054     
00055 }
00056 void White_Centre_Swap()
00057 {
00058     
00059 }
00060 
00061 void White_Corners()
00062 {
00063     
00064 }
00065 void Middle_Layer()
00066 {
00067 
00068 }
00069 void Top_Cross()
00070 {
00071     
00072 }
00073 void Top_Layer()
00074 {
00075     
00076 }
00077 void Corner_Positioning()
00078 {
00079     
00080 }
00081 void Edge_Orientation()
00082 {
00083     
00084 }