Exemplo n.º 1
0
Arquivo: gyro.go Projeto: 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
}
Exemplo n.º 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)
}
Exemplo n.º 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)
}