Makeblock-library-for-Arduino  V3.2.4
It's a library for arduino application developers
Classes | Macros
MeEncoderNew.h File Reference

Header for MeEncoderNew.cpp module. More...

#include <Arduino.h>
#include <stdbool.h>
#include "MeConfig.h"
#include "MePort.h"

Go to the source code of this file.


class  MeEncoderNew
 Driver for Me Encoder New module. More...


#define SDA_PORT   PORTB
#define SDA_PIN   7
#define SCL_PORT   PORTB
#define SCL_PIN   4
#define I2C_SLOWMODE   1
#define PULSE_PER_C   8

Detailed Description

Header for MeEncoderNew.cpp module.

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
This file is a drive for Me EncoderNew device, The Me EncoderNew inherited the MeSerial class from SoftwareSerial.
Method List:
  1. void MeEncoderNew::begin(void);
  2. void MeEncoderNew::move(long angle, float speed, float lock_state);
  3. void MeEncoderNew::moveTo(long angle, float speed,float lock_state);
  4. void MeEncoderNew::runSpeed(int speed);
  5. void MeEncoderNew::runTurns(long turns, float speed,float lock_state);
  6. void MeEncoderNew::reset(void);
  7. void MeEncoderNew::setSpeedPID(float p,float i,float d);
  8. void MeEncoderNew::setPosPID(float p,float i,float d);
  9. void MeEncoderNew::setMode(uint8_t mode);
  10. void MeEncoderNew::setPWM(int pwm);
  11. void MeEncoderNew::setCurrentPosition(long pulse_counter)
  12. long MeEncoderNew::getCurrentPosition();
  13. void MeEncoderNew::getSpeedPID(float * p,float * i,float * d);
  14. void MeEncoderNew::getPosPID(float * p,float * i,float * d);
  15. float MeEncoderNew::getCurrentSpeed(void);
  16. void MeEncoderNew::sendCmd(void);
  17. float MeEncoderNew::getRatio(void);
  18. void MeEncoderNew::setRatio(float r);
  19. int MeEncoderNew::getPulse(void);
  20. void MeEncoderNew::setPulse(int p);
  21. void MeEncoderNew::setDevid(int devid);
  22. void MeEncoderNew::runSpeedAndTime(float speed, float time, float lock_state);
  23. boolean MeEncoderNew::isTarPosReached(void);
<Author>         <Time>        <Version>        <Descr>
Mark Yan        2016/03/18     1.0.0            build the new

Macro Definition Documentation

#define I2C_SLOWMODE   1
#define PULSE_PER_C   8
#define SCL_PIN   4
#define SCL_PORT   PORTB
#define SDA_PIN   7
#define SDA_PORT   PORTB