Hello Tony!
Okay! I have purchased a Ping360 and I have this connection.
I can see the mapping of the intensities and distances through PingViewer.
Unfortunately, I can acquire the intensity/strength values but not the distance values.
What do I have to do, to get the distance values??
A code example is displayed below:
from brping import Ping360
import numpy as np
myPing = Ping360()
myPing.connect_serial(“/dev/ttyUSB0”, 115200)
if myPing.initialize() is False:
print(“Failed to initialize Ping!”)
exit(1)
data1 = myPing.transmitAngle(100)
data = np.frombuffer(data1.data, dtype=np.uint8)
print(“Locations:”,data.min(), data.max())
threshold = 200
print(“Threshold:”,np.where(data >= threshold))
OUTPUT:
Opening /dev/ttyUSB0 at 115200 bps
All locations: 0 255
Threshold: (array([ 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 73, 74]),)