Last change
on this file since 167 was
167,
checked in by (none), 14 years ago
|
Simeo: added final project and also older proof of concept code.
We used Git for version control, so look at the Git repo
in SIMEO/Simeo/ for more info.
|
File size:
417 bytes
|
Rev | Line | |
---|
[167] | 1 | #include <stdio.h> |
---|
| 2 | #include "Actuator.h" |
---|
| 3 | |
---|
| 4 | Actuator::Actuator(Channel *chan, channelData *data) |
---|
| 5 | : X(chan) |
---|
| 6 | { |
---|
| 7 | m_data = new channelData(*data); |
---|
| 8 | } |
---|
| 9 | |
---|
| 10 | Actuator::~Actuator() |
---|
| 11 | { |
---|
| 12 | delete m_data; |
---|
| 13 | } |
---|
| 14 | |
---|
| 15 | channelData *Actuator::getData() |
---|
| 16 | { |
---|
| 17 | return m_data; |
---|
| 18 | } |
---|
| 19 | |
---|
| 20 | void Actuator::setTargetAngle(float angle) |
---|
| 21 | { |
---|
| 22 | m_data->angle = angle; |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | void Actuator::update() |
---|
| 26 | { |
---|
| 27 | float angle; |
---|
| 28 | angle = m_data->angle; |
---|
| 29 | m_chan->write(&angle, MPI_FLOAT, 1); |
---|
| 30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.