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:
331 bytes
|
Rev | Line | |
---|
[167] | 1 | #include <stdio.h> |
---|
| 2 | #include "Sensor.h" |
---|
| 3 | |
---|
| 4 | |
---|
| 5 | Sensor::Sensor(Channel *chan, channelData *data) |
---|
| 6 | : X(chan) |
---|
| 7 | { |
---|
| 8 | m_data = new channelData(*data); |
---|
| 9 | } |
---|
| 10 | |
---|
| 11 | Sensor::~Sensor() |
---|
| 12 | { |
---|
| 13 | delete m_data; |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | channelData *Sensor::getData() |
---|
| 17 | { |
---|
| 18 | return m_data; |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | void Sensor::update() |
---|
| 22 | { |
---|
| 23 | float angle; |
---|
| 24 | m_chan->read(&angle, MPI_FLOAT, 1); |
---|
| 25 | m_data->angle = angle; |
---|
| 26 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.