MakeBlock Drive Updated
Updated library for MakeBlock Ranger
Loading...
Searching...
No Matches
MePS2.h File Reference

Header for MePS2.cpp module. More...

#include <stdbool.h>
#include <stdint.h>
#include <Arduino.h>
#include "MeConfig.h"
#include "MeSerial.h"
#include "MePort.h"
Include dependency graph for MePS2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MePS2
 Driver for MePS2 handle device. More...
 

Macros

#define MeJOYSTICK_RX   6
 
#define MeJOYSTICK_RY   8
 
#define MeJOYSTICK_LX   2
 
#define MeJOYSTICK_LY   4
 
#define MeJOYSTICK_R1   1
 
#define MeJOYSTICK_R2   3
 
#define MeJOYSTICK_L1   5
 
#define MeJOYSTICK_L2   7
 
#define MeJOYSTICK_TRIANGLE   9
 
#define MeJOYSTICK_XSHAPED   10
 
#define MeJOYSTICK_SQUARE   11
 
#define MeJOYSTICK_ROUND   12
 
#define MeJOYSTICK_START   13
 
#define MeJOYSTICK_UP   14
 
#define MeJOYSTICK_DOWN   15
 
#define MeJOYSTICK_LEFT   16
 
#define MeJOYSTICK_RIGHT   17
 
#define MeJOYSTICK_SELECT   18
 
#define MeJOYSTICK_MODE   19
 
#define MeJOYSTICK_BUTTON_L   20
 
#define MeJOYSTICK_BUTTON_R   21
 
#define MeJOYSTICK_INIT_VALUE   0
 
#define MeJOYSTICK_ANALOG_ERROR   0
 

Detailed Description

Header for MePS2.cpp module.

Author
MakeBlock
Version
V1.0.4
Date
2016/10/08
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 PS2 handle device, The MePS2 inherited the MeSerial class from SoftwareSerial.
Method List:
  1. uint8_t MePS2::readBuffer(int16_t index);
  2. void MePS2::writeBuffer(int16_t index,uint8_t c);
  3. void MePS2::readSerial(void);
  4. boolean MePS2::readjoystick(void);
  5. int16_t MePS2::MeAnalog(uint8_t button);
  6. boolean MePS2::ButtonPressed(uint8_t button);
  7. void MePS2::loop(void);
History:
`<Author>`         `<Time>`        `<Version>`        `<Descr>`
 Scott wang      2016/09/18         1.0.0            Build the new lib.
 Scott           2016/09/20         1.0.1            Correct the receive error.
 Scott           2016/09/22         1.0.2            Correct the connect error.
 Scott           2016/09/23         1.0.3            Add BUTTON_L and BUTTON_R.
 Mark Yan        2016/10/08         1.0.4            Modify data format.