![]() |
TALAS
0.8.1
Arduino Laser Tank with Bluetooth
|
TALAS rotating turret with laser gun. More...
#include <Turret.h>
Public Member Functions | |
Turret () | |
Constructor. | |
void | attach (uint8_t pinLaser) |
Attach turret with laser gun only. More... | |
void | attach (uint8_t pinLaser, uint8_t pinH, uint8_t pinV) |
Attach movable turret with laser gun. More... | |
void | setRange (uint8_t minH, uint8_t maxH, uint8_t minV, uint8_t maxV) |
Set servos angle range. More... | |
void | setDelta (uint8_t dH, uint8_t dV) |
Set servos angle increment/decrement value. More... | |
void | enable () |
Enable turret. | |
void | disable () |
Disable turret. | |
void | reset () |
Reset turret. More... | |
uint8_t | getH () |
Get current horizontal position. More... | |
uint8_t | getV () |
Get current vertical position. More... | |
void | up () |
Rotate turret up. | |
void | down () |
Rotate turret down. | |
void | left () |
Rotate turret left. | |
void | right () |
Rotate turret right. | |
void | impulse (unsigned long length) |
Fire laser gun. More... | |
Public Attributes | |
uint8_t | h0 |
Initial horizontal angle. | |
uint8_t | v0 |
Initial vertical angle. | |
TALAS rotating turret with laser gun.
void Turret::attach | ( | uint8_t | pinLaser | ) |
Attach turret with laser gun only.
pinLaser | pin for laser gun. |
Referenced by attach(), and Talas::attachTurret().
void Turret::attach | ( | uint8_t | pinLaser, |
uint8_t | pinH, | ||
uint8_t | pinV | ||
) |
Attach movable turret with laser gun.
pinLaser | pin for laser gun. |
pinH | pin for horizontal servo. |
pinV | pin for vertical servo. |
References attach().
uint8_t Turret::getH | ( | ) |
Get current horizontal position.
Referenced by Talas::dispatch(), and Talas::slower().
uint8_t Turret::getV | ( | ) |
Get current vertical position.
Referenced by Talas::dispatch(), and Talas::slower().
void Turret::impulse | ( | unsigned long | length | ) |
Fire laser gun.
Emit a laser impulse with specified length in ms.
length | impulse length (ms). |
Referenced by Talas::fire().
void Turret::reset | ( | ) |
Reset turret.
Turn to the initial position.
Referenced by Talas::attachTurret(), Talas::dispatch(), and Talas::slower().
void Turret::setDelta | ( | uint8_t | dH, |
uint8_t | dV | ||
) |
Set servos angle increment/decrement value.
dH,dV | new increment/decrement values. |
Referenced by Talas::slower().
void Turret::setRange | ( | uint8_t | minH, |
uint8_t | maxH, | ||
uint8_t | minV, | ||
uint8_t | maxV | ||
) |
Set servos angle range.
minH,maxH | horizontal range. |
minV,maxV | vertical range. |
Referenced by Talas::slower().