Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

sensor.cpp

Go to the documentation of this file.
00001 
00006 /*
00007  *  The contents of this file are subject to the Mozilla Public License
00008  *  Version 1.0 (the "License"); you may not use this file except in
00009  *  compliance with the License. You may obtain a copy of the License at
00010  *  http://www.mozilla.org/MPL/
00011  *
00012  *  Software distributed under the License is distributed on an "AS IS"
00013  *  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
00014  *  License for the specific language governing rights and limitations
00015  *  under the License.
00016  *
00017  *  The Original Code is legOS code, released October 17, 1999.
00018  *
00019  *  The Initial Developer of the Original Code is Markus L. Noga.
00020  *  Portions created by Markus L. Noga are Copyright (C) 1999
00021  *  Markus L. Noga. All Rights Reserved.
00022  *
00023  *  Contributor(s): Markus L. Noga <markus@noga.de>
00024  */
00025 
00026 #include "c++/sensor.h"
00027 
00028 
00029 unsigned* const Sensor::s1=&SENSOR_1;         
00030 unsigned* const Sensor::s2=&SENSOR_2;         
00031 unsigned* const Sensor::s3=&SENSOR_3;         
00032 unsigned* const Sensor::battery=&BATTERY;     
00033 
00034 
00035 RotationSensor::RotationSensor(unsigned *addr,int initial) : Sensor(addr,1) {
00036   ds_rotation_set(ptr,initial);
00037   ds_rotation_on(ptr);
00038   if(ptr==s1)
00039     posPtr=(int * volatile) ds_rotations+2;
00040   else if(ptr==s2)
00041     posPtr=(int * volatile) ds_rotations+1;
00042   else if(ptr==s3)
00043     posPtr=(int * volatile) ds_rotations;
00044 }

Generated on Fri Feb 25 08:02:38 2005 for brickos by  doxygen 1.3.9.1