Lamp control interface.
More...
#include <c++/Lamp.H>
Lamp control interface.
Define a lamp connection to the RCX so we can turn the lamp on(), off() or set its brightness().
- Note
- Lamps are controlled via motor ports so this is based on the Motor.H code
- See also
- The other control classes: Motor, MotorPair, Sound
Definition at line 39 of file Lamp.H.
◆ Port
The RCX output pad to which the Lamp is connected.
Enumerator |
---|
A | RCX output pad A.
|
B | RCX output pad B.
|
C | RCX output pad C.
|
Definition at line 44 of file Lamp.H.
◆ Lamp()
Lamp::Lamp |
( |
enum Port |
port | ) |
|
|
inline |
construct a lamp connected to {port}
- Parameters
-
port | designator of pad to which this lamp is connected |
Definition at line 54 of file Lamp.H.
◆ ~Lamp()
destroy our lamp instance
- Note
- the lamp is turned off when the instance is destroyed
Definition at line 66 of file Lamp.H.
References off().
◆ brightness()
const void Lamp::brightness |
( |
const unsigned char |
level | ) |
const |
|
inline |
Set the power to the lamp.
- Parameters
-
level | the desired power setting specifying the intensity of the light. [must be between min (0) and max (255)] |
- Returns
- Nothing
Definition at line 83 of file Lamp.H.
References speed().
◆ direction()
◆ off()
const void Lamp::off |
( |
| ) |
const |
|
inline |
◆ on()
const void Lamp::on |
( |
| ) |
const |
|
inline |
◆ speed()
const void Lamp::speed |
( |
const unsigned char |
speed | ) |
const |
|
inlineprivate |
◆ md
◆ ms
void(* Lamp::ms) (unsigned char speed) |
|
private |
The documentation for this class was generated from the following file: