Mindstorms 3rd Party ROBOTC Drivers RobotC
[Home] [Download] [Submit a bug/suggestion] [ROBOTC Forums] [Blog] [Support this project]
Defines | Functions | Variables

mindsensors-touchpanel.h File Reference

Mindsensors TouchPanel. More...

#include "common.h"

Go to the source code of this file.

Defines

#define MSTP_I2C_ADDR   0x04
#define MSTP_REG_TOUCH_X   0x42
#define MSTP_REG_TOUCH_Y   0x43
#define MSTP_REG_BUTTONS   0x44
#define MSTP_REG_CAL_XD1   0x45
#define MSTP_REG_CAL_YD1   0x46
#define MSTP_REG_CAL_XT1   0x47
#define MSTP_REG_CAL_YT1   0x48
#define MSTP_REG_CAL_XD2   0x49
#define MSTP_REG_CAL_YD2   0x4A
#define MSTP_REG_CAL_XT2   0x4B
#define MSTP_REG_CAL_YT2   0x4C
#define MSTP_REG_G_AVAIL   0x4D
#define MSTP_REG_G_NEXTX   0x4E
#define MSTP_REG_G_NEXTY   0x4F
#define BUTTON_L1   0
#define BUTTON_L2   1
#define BUTTON_L3   2
#define BUTTON_L4   3
#define BUTTON_R1   4
#define BUTTON_R2   5
#define BUTTON_R3   6
#define BUTTON_R4   7
#define MSTP_REG_RAW_BC   0x4D
#define MSTP_REG_RAW_X   0x4E
#define MSTP_REG_RAW_Y   0x4F
#define isButtonTouched(X, Y)   (X >> Y) & 0x01
#define isButtonL1Touched(X)   (X >> BUTTON_L1) & 0x01
#define isButtonL2Touched(X)   (X >> BUTTON_L2) & 0x01
#define isButtonL3Touched(X)   (X >> BUTTON_L3) & 0x01
#define isButtonL4Touched(X)   (X >> BUTTON_L4) & 0x01
#define isButtonR1Touched(X)   (X >> BUTTON_R1) & 0x01
#define isButtonR2Touched(X)   (X >> BUTTON_R2) & 0x01
#define isButtonR3Touched(X)   (X >> BUTTON_R3) & 0x01
#define isButtonR4Touched(X)   (X >> BUTTON_R4) & 0x01
#define MSTPresetCalibration(x)   MSTPsendCmd(tSensors link, ubyte cmd, ubyte addr = MSTP_I2C_ADDR);

Functions

bool MSTPgetTouch (tSensors link, int &x, int &y, ubyte &buttons, ubyte addr=MSTP_I2C_ADDR)
bool MSTPsendCmd (tSensors link, ubyte cmd, ubyte addr=MSTP_I2C_ADDR)

Variables

tByteArray MSTP_I2CRequest
tByteArray MSTP_I2CReply

Detailed Description

Mindsensors TouchPanel.

mindsensors-touchpanel.h provides an API for the Mindsensors TouchPanel.

Changelog:

Credits:

License: You may use this code as you wish, provided you give credit where it's due.

THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 3.59 AND HIGHER.

Author:
Xander Soldaat
Date:
30 November 2011
Version:
0.1

Definition in file mindsensors-touchpanel.h.