MakeBlock Drive Updated
Updated library for MakeBlock Ranger
Loading...
Searching...
No Matches
MeEncoderMotor.cpp File Reference

Driver for Encoder Motor module. More...

#include "MeEncoderMotor.h"
#include "MeHostParser.h"
Include dependency graph for MeEncoderMotor.cpp:

Macros

#define ENCODER_MOTOR_GET_PARAM   0x01
 
#define ENCODER_MOTOR_SAVE_PARAM   0x02
 
#define ENCODER_MOTOR_TEST_PARAM   0x03
 
#define ENCODER_MOTOR_SHOW_PARAM   0x04
 
#define ENCODER_MOTOR_RUN_STOP   0x05
 
#define ENCODER_MOTOR_GET_DIFF_POS   0x06
 
#define ENCODER_MOTOR_RESET   0x07
 
#define ENCODER_MOTOR_SPEED_TIME   0x08
 
#define ENCODER_MOTOR_GET_SPEED   0x09
 
#define ENCODER_MOTOR_GET_POS   0x10
 
#define ENCODER_MOTOR_MOVE   0x11
 
#define ENCODER_MOTOR_MOVE_TO   0x12
 
#define ENCODER_MOTOR_DEBUG_STR   0xCC
 
#define ENCODER_MOTOR_ACKNOWLEDGE   0xFF
 

Functions

uint32_t MeHost_Pack (uint8_t *buf, uint32_t bufSize, uint8_t module, uint8_t *data, uint32_t length)
 

Variables

MeHostParser encoderParser = MeHostParser()
 

Detailed Description

Driver for Encoder Motor module.

Author
MakeBlock
Version
V1.0.1
Date
2015/11/09
Copyright
This software is Copyright (C), 2012-2016, MakeBlock. Use is subject to license
conditions. The main licensing options available are GPL V2 or Commercial:
Open Source Licensing GPL V2
This is the appropriate option if you want to share the source code of your
application with everyone you distribute it to, and you also want to give them
the right to share who uses it. If you wish to use this software under Open
Source Licensing, you must contribute all your source code to the open source
community in accordance with the GPL Version 2 when your application is
distributed. See http://www.gnu.org/copyleft/gpl.html
Description
This file is a drive for Me EncoderMotor device, The Me EncoderMotor inherited the MeSerial class from SoftwareSerial.
Method List:
  1. void MeEncoderMotor::begin();
  2. boolean MeEncoderMotor::reset();
  3. boolean MeEncoderMotor::move(float angle, float speed);
  4. boolean MeEncoderMotor::moveTo(float angle, float speed);
  5. boolean MeEncoderMotor::runTurns(float turns, float speed);
  6. boolean MeEncoderMotor::runSpeed(float speed);
  7. boolean MeEncoderMotor::runSpeedAndTime(float speed, float time);
  8. float MeEncoderMotor::getCurrentSpeed();
  9. float MeEncoderMotor::getCurrentPosition();
History:
`<Author>`         `<Time>`        `<Version>`        `<Descr>`
Mark Yan        2015/11/03     1.0.0            Fix minor errors on format
forfish         2015/11/09     1.0.1            Add description

Function Documentation

◆ MeHost_Pack()

uint32_t MeHost_Pack ( uint8_t *  buf,
uint32_t  bufSize,
uint8_t  module,
uint8_t *  data,
uint32_t  length 
)
Function
MeHost_Pack
Description
Pack data into a package to send.
Parameters
[in]buf- Buffer to save package.
[in]bufSize- Size of buf.
[in]module- The associated module of package.
[in]data- The data to pack.
[in]length- The length(size) of data.
Output
None \Return 0.
Others
package size.