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.
Dependents: 2022_NHK_B_UK 2022_NHK_B_sub2
SEKIkikou.h
00001 00002 #ifndef SEKIKIKOU 00003 00004 #define SEKIKIKOU 00005 00006 #include "mbed.h" 00007 #include "ikarashiMDC.h" 00008 00009 /*サンプルコード 00010 00011 00012 #include "mbed.h" 00013 #include "SEKIkikou.h" 00014 00015 Serial serial(PC_10, PC_11, 115200); 00016 00017 ikarashiMDC motor[] = { 00018 ikarashiMDC(0,0,SM,&serial), 00019 ikarashiMDC(0,1,SM,&serial), 00020 ikarashiMDC(0,2,SM,&serial), 00021 }; 00022 00023 int main(){ 00024 uint8_t b[4]; 00025 int env[3]; 00026 SEKIkikou seki(&motor[0], &motor[1], &motor[2], &b[0], &b[1], &b[2], &b[3], &env[0], &env[1], &env[2]); 00027 00028 for(int i=0; i<4; i++){ 00029 b[i] = 0; 00030 if(i < 3) env[i] = 0; 00031 } 00032 00033 while(1){ 00034 seki.runLift(0.1); 00035 } 00036 } 00037 00038 */ 00039 00040 class SEKIkikou 00041 { 00042 public: 00043 00044 SEKIkikou(ikarashiMDC *ik1, ikarashiMDC *ik2, ikarashiMDC *ik3, uint8_t *b1, uint8_t *b2, uint8_t *b3, uint8_t *b4, int *env1, int *env2, int *env3); 00045 00046 void init(ikarashiMDC *ik1, ikarashiMDC *ik2, ikarashiMDC *ik3, uint8_t *b1, uint8_t *b2, uint8_t *b3, uint8_t *b4, int *env1, int *env2, int *env3); 00047 00048 void runAll(float speedI, float speedLoad, float speedLift, int angle); 00049 00050 void runInjection(float speed); 00051 00052 void runLoad(float speed); 00053 00054 void runLift(float speed, int angle); 00055 00056 void stopAll(); 00057 00058 private: 00059 Timer timer; 00060 uint8_t *button[4]; 00061 int *encoder[3]; 00062 int encoderAngle[3]; 00063 int liftFlag; 00064 int envBuff; 00065 int buff[2]; 00066 float mspeed[3]; 00067 bool injecterFlag; 00068 ikarashiMDC *ik[3]; 00069 }; 00070 00071 #endif
Generated on Thu Oct 13 2022 07:28:15 by
1.7.2