I’ve been trying to use Bno055 sensor data in a Pd patch compiled with Heavy using pd2dsy
. Until now, I didn’t succeed, but I’m summarizing here what I’ve done so far - maybe it will help someone else. And would be great to actually get this working since I think it has a lot of potential for Daisy based instruments.
Since the sensor is mentioned in https://github.com/electro-smith/pd2dsy/blob/master/README.md, I naively tried to just add it in a custom JSON like this:
{
"name": "bno_test",
"som": "seed",
"audio": {
"channels": 2
},
"components": {
"bno": {
"component": "Bno055"
}
}
}
This will cause an error though since the component is not known by the current libDaisy
version. There is a branch though that can be merged before recompiling libDaisy
GitHub - electro-smith/libDaisy at bno055.
This will result in another error message since the pins are not defined as expected:
Error c2daisy: 'pin_scl'
I tried with different definitions like:
"bno": {
"component": "Bno055",
"pin_scl": 11,
"pin_sda": 12
}
and (similar to the “i2c” definition in the petal.json
):
"bno": {
"component": "Bno055",
"pin": {
"sdl": 11,
"sda": 12
}
}
Both of these don’t work and I don’t know yet what the proper definition would look like. I then removed this part in the map_init
part of the Bno055
definition in the component_defs.json
:
{name}_config.scl = som.GetPin({pin_scl});\n {name}_config.sda = som.GetPin({pin_sda});\n
The default pins are defined in https://github.com/electro-smith/libDaisy/blob/8805f77a49a3c03a961945eaed369d2dda5bf8e8/src/dev/bno055.h anyway if I interpret this correctly:
scl = {DSY_GPIOB, 8};
sda = {DSY_GPIOB, 9};
I don’t understand the 8
and 9
here - but they seem to map to D11 and D12 in the Daisy pinout map according to https://github.com/electro-smith/libDaisy/blob/master/src/daisy_seed.h#L208C1-L209C39
With these changes, the patch compiles successfully with pd2dsy
- unfortunately the sensor data doesn’t seem to be read correctly anyway and there are no changes to the sound with a simple patch like this:
I hadn’t put any pull-up resistors - assuming that it should work in the same setup as with an ESP32 (thanks for this hint, Takumi_Ogata!). I added them now (2 x 10K), connecting the Daisy’s digital 3.3V pin with SDA and SCL. No luck.
I’ll put this aside for now, but I’ll get back to it when I have more time, tools and understanding.
One detail might be relevant: the sensor has an SCK pin, not SCL (see Bosch BNO055 Breakout - intelligenter 9-Axen Absolutorientierungs-Sensor). For the ESP32 setup, everything worked fine anyway - but I have no clue if that might cause some trouble here. Will definitely check with another I2C BNO055 soon. Any support is warmly welcome!