Example #1
0
File: gyro.go Project: tthk/GoEV3
// Reads the rotational speed in range [-440, 440].
func (self *GyroSensor) ReadRotationalSpeed() int16 {
	snr := findSensor(self.port, TypeGyro)

	path := fmt.Sprintf("%s/%s", baseSensorPath, snr)
	value := utilities.ReadInt16Value(path, "value1")

	return value
}
Example #2
0
// CurrentPower reads the operating power of the motor at the given port.
func CurrentPower(port OutPort) int16 {
	return utilities.ReadInt16Value(findFolder(port), powerGetterFD)
}
Example #3
0
// CurrentSpeed reads the operating speed of the motor at the given port.
func CurrentSpeed(port OutPort) int16 {
	return utilities.ReadInt16Value(findFolder(port), speedGetterFD)
}