⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lightsensor.c

📁 为参加日本的ET机器人比赛写的LEGO机器人控制程序
💻 C
字号:
/******************************************************************************\
*
* File:          LightSensor.C
* Creation date: June 23, 2008 10:30
* Latest update: July 09, 2008 16:39
* Author:        ClassBuilder
*                XXXX
* Purpose:       Method implementations of class 'LightSensor'
* CB version:    ClassBuilder Version 2.9 (PR523)
*
* Modifications: @INSERT_MODIFICATIONS(* )
* July 05, 2008 14:29 Chijinliang
*     Added method 'GetRawValue'
*     Updated code of method 'Initialize'
*     Updated code of method 'GetValue'
*     Updated code of method 'GetCurrent'
* June 24, 2008 19:58 Chijinliang
*     Updated code of method 'GetRawValue'
*     Updated code of method 'GetCurrent'
*     Updated code of method 'LightSensor'
* June 24, 2008 19:44 Chijinliang
*     Added method 'Passive'
*     Added method 'Active'
*     Updated code of method 'Initialize'
*     Updated code of method '~LightSensor'
* June 23, 2008 13:46 Chijinliang
*     Deleted inheritance 'Sensor'
* June 23, 2008 13:42 Chijinliang
*     Added method 'Initialize'
*     Added method 'GetRawValue'
*     Updated code of method 'LightSensor'
* June 23, 2008 10:53 Chijinliang
*     Added method 'LightSensor'
*     Updated member 'm_sensorValue'
* June 23, 2008 10:30 Chijinliang
*     Added method 'DestructorInclude'
*     Added method 'ConstructorInclude'
*     Added method 'GetCurrent'
*     Added method '~LightSensor'
*     Added inheritance 'Sensor'
*     Added member 'm_m_sensorValue'
*
* Copyright 2008, XXXXX
* All rights are reserved. Reproduction in whole or part is prohibited
* without the written consent of the copyright owner.
*
\******************************************************************************/
// Master include file
#include "JASTInTime.h"


using namespace JASTInTime;




/*
Constructor method.
*/
LightSensor::LightSensor()
{
    ConstructorInclude();

    Active();
    m_sensorValue = 0;
}


/*
Destructor method.
*/
LightSensor::~LightSensor()
{
    Passive();

    DestructorInclude();
}


void LightSensor::Active() const
{
    ds_active(&SENSOR_1);
}


unsigned int LightSensor::GetCurrent()
{
    unsigned int value = GetValue();

    // TODO:: Enter code for method 'GetCurrent'

    return value;
}


const unsigned int LightSensor::GetRawValue() const
{
    return SENSOR_1;
}


const unsigned int LightSensor::GetValue() const
{
    return LIGHT(SENSOR_1);
}


void LightSensor::Initialize()
{
    Active();
    m_sensorValue = GetValue();
}


void LightSensor::Passive() const
{
    ds_passive(&SENSOR_1);
}


/*
Method which must be called first in a constructor.
*/
void LightSensor::ConstructorInclude()
{
}


/*
Method which must be called first in a destructor.
*/
void LightSensor::DestructorInclude()
{
}


// Methods for the relation(s) of the class


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -