brian.sensors.HiTec package¶
brian.sensors.HiTec.GyroSensorHiTec module¶
- class brian.sensors.HiTec.GyroSensorHiTec.GyroSensorHiTec(port: SensorPort)¶
Bases:
SensorClass for interacting with HiTec gyro sensor.
Sensor is automatically registered in the constructor of the base class and un-registered in its destructor. It can also be unregistered with the
GyroSensorHiTec.close_sensor()function.There can be at most one instance at any given time, of any sensor class per port in the entire program.
- __init__(port: SensorPort)¶
Initialize an HiTec gyro sensor at the given port.
- Parameters:
port – Sensor port to which the sensor is attached.
- speed() int¶
Measures the sensor state. Returns the angular speed in range -500 to 400
- Returns:
angular speed in degrees/second (-500 to 400).
- Raises:
brian.sensors.SensorIsNotReadyError – If the sensor is not ready.