Hey Brett.
Sorry for the confusion regarding the proper version of python, etc. but I’ve never had any success with the Windows store version of the software. I usually download/install python from here.
There is some disconnect between the python
command on windows, and other OSes. On some OSes, python
still means python 2. The important thing is that python --version
or python3 --version
returns anything 3.7.0
or higher to use the json2daisy module.
To address your specific questions:
- The default components are used internally to configure the Initialization of the components/devices added in the json file.
- The SOM field is just to specify between
seed
based boards, and patch_sm
(an upcoming piece of hardware). No additional files are needed.
- Most, if not all of the defines are carried over for support with the current implementation of oopsy (max/msp~ gen support). Unless you plan on using that integration you don’t need to worry about the defines much.
As you suspected you could strip most of what you need from the field.json template that’s in the repo.
I didn’t test it through the script, but something like this should generate a structure with Initialization code for a single LED Driver with the ADDR pins set to 0.
{
"name": "led_board",
"som": "seed",
"display": {},
"audio": {
"channels": 2
},
"parents": {
"i2c": {
"component": "i2c",
"pin": {
"scl": 11,
"sda": 12
}
},
"led_driver": {
"component": "PCA9685",
"address": "{0x00}",
"parent": "i2c",
"driver_count": 1
}
},
"components" : {
"led_key_b1": {
"component": "PCA9685Led",
"index": 0,
"parent": "led_driver"
},
"led_key_b2": {
"component": "PCA9685Led",
"index": 1,
"parent": "led_driver"
},
"led_key_b3": {
"component": "PCA9685Led",
"index": 2,
"parent": "led_driver"
},
}
}
You could also use the DaisyPetal or DaisyField class in libDaisy as a starting point for own class in c++ (bypassing the json altogether).
We do have some documentation for libDaisy on the web, but it is very much a work in progress.
We’re hoping to provide better documentation specifically for working with external devices, and writing some guides for writing code for custom hardware over the next few months. In the meantime, I hope some of the above is useful, and helpful!