The past week I received a BrickPi and connected it to my Raspberry Pi without problems. I connected a Lego ultrasonic sensor to, what on the diagram
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.
Any questions, suggestions or comments?
Thanks!
Brenda