Sensor Port 5 not in BrickPi.py


#1

Hi I’m just wondering if this is mistaken or something but the Python script for the Brick Pi doesn’t have anything to initialize to the fifth sensor port.

PORT_A = 0
PORT_B = 1
PORT_C = 2
PORT_D = 3

PORT_1 = 0
PORT_2 = 1
PORT_3 = 2
PORT_4 = 3

https://github.com/DexterInd/BrickPi_Python/blob/master/BrickPi.py

There’s no PORT_5 in the global variables and in the class for the BrickPi it’s just going up to index 3 (PORT 1 to 4)

There’s the fifth sensor port from the BrickPi’s Attaching LEGO section on http://www.dexterindustries.com/BrickPi/getting-started/


#2

Hey Zewwo,
The fifth port is an I2C port. You can use it with any of the I2C sensors, and the I2C is controlled directly by the Raspberry Pi (which allows you to do much faster I2C communications).

We have an example of using Port 5 with a sensor in our BrickPi_Python library, called “dIMU_on_Sensor_5.py”

It requires a different method for setup than you would using the other four sensors.