Lego 45305 Tilt Sensor with Spike Prime Hub
I'm trying to use a Lego 45305 tilt sensor with a Spike Prime Hub. The Pybricks documentation says they are compatible and the sensor seems to be detected correctly as I'm not getting any errors. When I try to read the pitch and roll angles using the Pybricks blocks (the following code):
ArmTilt = TiltSensor(Port.C)
async def main() global ArmPitch, ArmRoll ArmPitch = ArmTilt.tilt()[0] ArmRoll = ArmTilt.tilt()[1] print(ArmPitch, ArmRoll, sep=", ")
run_task(main())
I get the following error: TypeError: 'wait' object isn't subscriptable. It also notes the code line "ArmPitch = ArmTilt.tilt()[0]" as having a problem, even though this is the code generated by using the Orientation block, sensor/hub get pitch/roll.
There is other code in the file, of course, but I only included this portion as the issue is only related to the tilt sensor.