Пример #1
0
Файл: gyro.go Проект: 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
}
Пример #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)
}
Пример #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)
}