ETrobocon2017 - 片山研究所モデルベース開発推進事業部
str
ev3-api
library
libcpp-ev3
src
Steering.cpp
[詳解]
1
//
2
// Steerng.cpp
3
//
4
// Copyright (c) 2016 Embedded Technology Software Design Robot Contest
5
//
6
7
#include "
Steering.h
"
8
using namespace
ev3api
;
9
10
//=============================================================================
11
// Constructor
12
Steering::Steering
(
Motor
& leftMotor,
Motor
& rightMotor)
13
:mLeftMotor(leftMotor), mRightMotor(rightMotor) {}
14
15
//=============================================================================
16
// Cset steering power
17
void
Steering::setPower
(
int
power,
int
turnRatio)
18
{
19
(void)ev3_motor_steer(mLeftMotor.
getPort
(), mRightMotor.
getPort
(), power, turnRatio);
20
}
21
ev3api
Definition:
Clock.h:12
Steering.h
ev3api::Motor::getPort
motor_port_t getPort(void) const
Definition:
Motor.h:105
ev3api::Motor
Definition:
Motor.h:17
ev3api::Steering::setPower
void setPower(int power, int turnRatio)
Definition:
Steering.cpp:17
ev3api::Steering::Steering
Steering(Motor &leftMotor, Motor &rightMotor)
Definition:
Steering.cpp:12
構築:
1.8.13