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

mindsensors-numericpad.h File Reference

Mindsensors Numeric Keypad Sensor driver. More...

#include "common.h"

Go to the source code of this file.

Defines

#define MSNP_I2C_ADDR   0xB4
#define MSNP_DATA_REG   0x00
#define KEY_STATUS_REG   0x00

Functions

bool _MSNPinit (tSensors link)
bool MSNPscanKeys (tSensors link, int &pressedKeys, unsigned byte &key, int &number)
int MSNPscanKeys (tSensors link)

Variables

tByteArray MSNP_I2CRequest
tByteArray MSNP_I2CReply
const unsigned byte MSNP_KeyMap [] = { '#', '9', '6', '3', '0', '8', '2', '5', '*', '7', '1', '4' }
const signed byte MSNP_NumMap [] = { -1, 9, 6, 3, 0, 8, 2, 5, -2, 7, 1, 4}
const unsigned byte MSNP_ConfigGroup1 [] = {10, MSNP_I2C_ADDR, 0x2B, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0xFF, 0x02}
const unsigned byte MSNP_ConfigGroup2 [] = {16, MSNP_I2C_ADDR, 0x41, 0x0F, 0x0A, 0x0F, 0x0A, 0x0F, 0x0A, 0x0F, 0x0A, 0x0F, 0x0A, 0x0F, 0x0A, 0x0F, 0x0A}
const unsigned byte MSNP_ConfigGroup3 [] = {14, MSNP_I2C_ADDR, 0x4F, 0x0F, 0x0A, 0x0F, 0x0A, 0x0F, 0x0A, 0x0F, 0x0A, 0x0F, 0x0A, 0x0F, 0x0A}
const unsigned byte MSNP_ConfigGroup4 [] = { 5, MSNP_I2C_ADDR, 0x5C, 0x0B, 0x20, 0x0C}
const unsigned byte MSNP_ConfigGroup5 [] = { 3, MSNP_I2C_ADDR, 0x7B, 0x0B}
const unsigned byte MSNP_ConfigGroup6 [] = { 5, MSNP_I2C_ADDR, 0x7D, 0x9C, 0x65, 0x8C}
bool _MSNPinitialised [] = {false, false, false, false}

Detailed Description

Mindsensors Numeric Keypad Sensor driver.

mindsensors-numericpad.h provides an API for the Mindsensors Numeric Keypad Sensor.

Changelog:

Credits:

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

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

Author:
Xander Soldaat (xander_at_botbench.com)
Date:
30 October 2010
Version:
0.1

Definition in file mindsensors-numericpad.h.