TouchSensor.H
Go to the documentation of this file.
1
7//
8// The contents of this file are subject to the Mozilla Public License
9// Version 1.0 (the "License"); you may not use this file except in
10// compliance with the License. You may obtain a copy of the License
11// at http://www.mozilla.org/MPL/
12//
13// Software distributed under the License is distributed on an "AS IS"
14// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15// the License for the specific language governing rights and
16// limitations under the License.
17//
18// This software was developed as part of the legOS project.
19//
20// Contributor: Pat Welch (legOS@mousebrains.com)
21#ifndef _TouchSensor_H_
22#define _TouchSensor_H_
23
24#include <config.h>
25#include <c++/Sensor.H>
26
27#if defined(CONF_DSENSOR)
28
44class TouchSensor : public Sensor {
45public:
51 TouchSensor(const Sensor::Port port) : Sensor(port, false) {}
56 bool pressed() const {return TOUCH(sensor);}
57};
58
59#else // CONF_DSENSOR
60#warning Enable CONF_DSENSOR to use TouchSensor.H
61#endif // CONF_DSENSOR
62#endif // _TouchSensor_H_
C++ Sensor Class Interface.
Basic sensor interface.
Definition Sensor.H:54
volatile unsigned int & sensor
The address of our sensor value.
Definition Sensor.H:181
Port
List of sensor identifiers (IDs).
Definition Sensor.H:67
Touch-sensor interface (passive mode).
Definition TouchSensor.H:44
bool pressed() const
determine if touch sensor is pressed
Definition TouchSensor.H:56
TouchSensor(const Sensor::Port port)
construct a TouchSensor connected to pad {port}
Definition TouchSensor.H:51
kernel configuration file
#define TOUCH(a)
Convert raw data to touch sensor (0: off, else pressed)
Definition dsensor.h:118

brickOS is released under the Mozilla Public License.
Original code copyright 1998-2005 by the authors.

Generated for brickOS Kernel Developer by doxygen 1.9.8