Thanks a lot for continuing to help crack this puzzle! This has been useful to go through as I've found some "anomalies"? Perhaps...
I realised as well I should probably clarify that when I say "doesn't work" I mean I'm getting constant "zeros"/no audio reaction on the Bela IDE console readings (instead of data readings/numerical values & reactive audio when the sensor is "working"). Just in case it could be an issue with how the data is being handled rather than the sensor "not working", though it does seem like a power thing or something weird with how I've circuited/hooked up the sensors maybe?
a- I was using the analog 5V, not P9.07/08!
b- I connected the sensor fully to Bela (it's vcc/gnd/trig/echo pins) when testing before - is this what you mean by GPIO?
I tried some multimeter tests and got these results...
Analog 5V:
- one sensor connected: 3.5V (working: sends/receives data on Bela IDE console/Pure Data audio reacts)
- two sensors connected: 2.9V (no data)
P9.07:
- one sensor connected: 4.9V (no data - weird?)
- two sensors connected: 3-4V (no data)
Not sure if this is weird or a clue - one sensor works/sends data when using the analog 5V, but switch to P9.07 and that sensor stops working. I get a pretty consistent 4.9V reading between P9.07 & GND (Bela pins) and just to be sure I checked on the Sensor Vcc/GND pins and it's about the same.
Tried your power supply suggestion too, using positive/negative voltages of a USB/barrel jack (with a USB battery pack), running negative to the Bela & sensor, positive just to the sensor, and trigger/echos to BELA (if I've understood this correctly?). I get fairly consistent readings of 3-4.5V, both Bela & sensor don't power on/no reaction.
RE the code error that's quite likely what I did wrong!
Does this give you any clues?