I got two ultrasonic sensor connect with my ultimate2.0 megapi board. I run the python code on raspberry pi 3B:
def onReadLeft(v):
print v
def onReadRight(v):
print v
bot = Megapi()
bot.start(’/dev/serial0’)
while 1:
sleep(1)
bot.ultrasonicSensorRead(8, onReadLeft)
bot.ultrasonicSensorRead(6, onReadRight)
but the two ultrasonic sensor return the same distance. If I run only each one ultrasonic sensor, it’s work good. When two work together, return the same distance value.
How to fix this? Thanks.