is S1. I wrote a very simple python script, assigning BrickPi.SensorType[PORT_1] = TYPE_SENSOR_ULTRASONIC_CONT and ran a 60 sec loop updating result = BrickPiUpdateValues() and print BrickPi.Sensor[PORT_1].
All worked as expected. So I added a Lego touch sensor on S2 and to the python script added BrickPi.SensorType[PORT_2] = TYPE_SENSOR_TOUCH and print BrickPi.Sensor[PORT_2]. Running the script, neither sensor worked.
I modified the script, commenting out the references to the touch sensor and the sonic sensor worked. To shorten the story, after further experimentation, it doesn’t matter whether a sensor is connected to S1 or S2, I have to use PORT_1 to address both S1 & S2 and, as expected, I can only have 1 sensor defined in the python script and it doesn’t matter whether to sensor is connected to S1 or S2 as long as the script uses the value PORT_1.
I’m sorry for the confusion here. I think the problem might have been solved a month back with the Ultrasonic sensor; in April we did a push up to Github with the latest code for Python. There was an error with the drivers we corrected.
These errors were in the BrickPi.py module, which we corrected, but needs to be reinstalled.
After updating the latest code, you’ll need to reinstall the BrickPi Python module. There are only a few steps for that, and they’re on the same page (https://github.com/DexterInd/BrickPi_Python)
I hope that helps. We’re sorry about the extra work this presents!
Hey Brenda,
We were just digging into the firmware again yesterday and sorted out a few more bugs. If you haven’t updated the software yet, I recommend making sure you get the latest version out of github.
You’ll need to uninstall the old version, and re-install the new version.