NHK2017Ateamかにろぼ

Dependencies:   2017NHKpin_config mbed FEP HMC6352 MotorDriverController PID QEI omni

classDiagram

    \ ̄\                   / ̄/ 
/l     \  \             /  / lヽ  
| ヽ  ヽ   |           |  /  / | 
\ ` ‐ヽ  ヽ  ●        ●         /  / ‐  / 
  \ __ l  |  ||___|| /  l __ / 
     \  \ /      \/ 
      /\|   人__人  |/\       
    //\|             |/\\     
    //\|             |/\\     
    /     . \_____/         \ 

                               ┏┓        ┏━┓┏┓              
     ┏┓         ┏┓┏┓   ┏┓    ┏┓┗┛     ┏┓ ┗┓┃┗┛              
┏┛┗━┓  ┃┃┃┃    ┃┃┏━┛┗┓┏┓┏┛┗━┓┃┃┏┓┏┓┏━━━┓ 
┗┓┏━┛  ┃┃┗┛    ┃┃┗━┓┏┛┗┛┗┓┏┓┃┗┛┗┛┃┃┗━━━┛    
┏┛┃┏━┓┃┗━━┓┃┃┏━┛┗┓      ┏┛┃┃┃        ┃┃              
┃┏┛┗━┛┗━━┓┃┃┃┃┏┓┏┛      ┗━┛┃┃        ┃┃┏┓          
┃┃┏━━┓┏━━┛┃┃┃┃┗┛┃         ┏┛┃        ┃┃┃┗━━┓    
┗┛┗━━┛┗━━━┛┗┛┗━━┛         ┗━┛        ┗┛┗━━━┛  

bot/bot.cpp

Committer:
UCHITAKE
Date:
2017-08-24
Revision:
5:bc5ba4f070ad
Parent:
2:ea151e05033a
Child:
15:9a2dce34b660

File content as of revision 5:bc5ba4f070ad:

#include "bot.h"

Bot::Bot() : Controller(), MotorDriver(), PIDC()
{
}

void Bot::confirmAll()
{
    receiveState();
    confirm();
    if(vector2[1] > 0.5)setSetPoint(vector2[0]);
}

void Bot::controllDrive()
{
    goXY(stick[0],stick[1], co);
}

void Bot::controllMech()
{
    if(!Button1[0]) moveSlider(ARM_MAX_SPEED);
    if(!Button1[1]) moveSlider(-ARM_MAX_SPEED);
    if(Button1[0] && Button1[1]) moveSlider(0);

    if(!Button1[2]) {
        destroy(DESTROY_MAX_SPEED);
    } else {
        destroy(0);
    }
}