-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package drivers | ||
|
||
// Measurement specifies a type of measurement, | ||
// for example: temperature, acceleration, pressure. | ||
type Measurement uint32 | ||
|
||
// Sensor measurements | ||
const ( | ||
Temperature Measurement = 1 << iota | ||
Humidity | ||
Pressure | ||
Distance | ||
Acceleration | ||
AngularVelocity | ||
MagneticField | ||
Luminosity | ||
Time | ||
|
||
AllMeasurements Measurement = 0xffffffff | ||
) | ||
|
||
// Sensor represents an object capable of making one | ||
// or more measurements. A sensor will then have methods | ||
// which read the last updated measurements. | ||
// | ||
// Many Sensors may be collected into | ||
// one Sensor interface to synchronize measurements. | ||
type Sensor interface { | ||
Update(which Measurement) error | ||
} |