Failing to make a JSON for the Terrarium PCB

I thought this would be easy.
So, after rewriting the JSON for the mysterious “petal_125b_sm.json” that comes with the latest Oopsy (bootloader-additions branch) for the pins of the Terrarium PCB, Oopsy hangs on compile attempt. I loaded my terrarium.json with the little browse button on the Oopsy~ object. No luck.
I have reached the limits of my hacking skills, as I am a poor programmer in reality and have a bad habit of not reading documentation, just beating snippets into submission when possible :slight_smile:
Any assistance would be appreciated.



{
	"name": "terrarium",
	"som": "terrarium",
	"audio": {
  		"channels": 1
 	 },
	"components": {
		"knob1": {
			"component": "AnalogControl",
			"pin": 23
		},
		"knob2": {
			"component": "AnalogControl",
			"pin": 24
		},
		"knob3": {
			"component": "AnalogControl",
			"pin": 25
		},
		"knob4": {
			"component": "AnalogControl",
			"pin": 26
		},
		"knob5": {
			"component": "AnalogControl",
			"pin": 27
		},
		"knob6": {
			"component": "AnalogControl",
			"pin": 28
		},
		"sw1": {
			"component": "Switch",
			"pin": 11
		},
		"sw2": {
			"component": "Switch",
			"pin": 10
		},
		"sw3": {
			"component": "Switch",
			"pin": 9
		},
		"sw4": {
			"component": "Switch",
			"pin": 8
		},
		"sw5": {
			"component": "Switch",
			"pin": 32
		},
		"sw6": {
			"component": "Switch",
			"pin": 33
		},
		"led1": {
			"component": "Led",
			"pin": 29
		},
		"led2": {
			"component": "Led",
			"pin": 30
		}
	},
	"aliases": {
		"switch1": "sw1",
		"switch2": "sw2",
		"switch3": "sw3",
		"switch4": "sw4",
		"switch5": "sw5",
		"switch6": "sw6",
		"sw_1": "sw1",
		"sw_2": "sw2",
		"sw_3": "sw3",
		"sw_4": "sw4",
		"sw_5": "sw5",
		"sw_6": "sw6",

		"kn1": "knob1",
		"kn2": "knob2",
		"kn3": "knob3",
		"kn4": "knob4",
		"kn5": "knob5",
		"kn6": "knob6",
		"kn_1": "knob1",
		"kn_2": "knob2",
		"kn_3": "knob3",
		"kn_4": "knob4",
		"kn_5": "knob5",
		"kn_6": "knob6",
	}
}

1 Like

I had such a tough time with the JSON for the Terrarium when I started with Oopsy. Here’s the simple one I’ve been working with for a while.

{
  "name": "pttl",
  "som": "seed",
  "defines": {
      "OOPSY_TARGET_HAS_MIDI_INPUT": 0
  },
  "audio": {
      "channels": 1
  },
  "components": {
      "sw1": {
          "component": "Switch",
          "pin": 8
      },
      "sw2": {
          "component": "Switch",
          "pin": 9
      },
      "sw3": {
          "component": "Switch",
          "pin": 10
      },
      "sw4": {
          "component": "Switch",
          "pin": 13
      },      
      "sw5": {
          "component": "Switch",
          "pin": 25
      },
      "sw6": {
          "component": "Switch",
          "pin": 26
      },      
      "sw7": {
          "component": "Switch",
          "pin": 7
},
      "knob1": {
        "component": "AnalogControl",
        "pin": 16
      },
      "knob2": {
        "component": "AnalogControl",
        "pin": 19
      },
      "knob3": {
        "component": "AnalogControl",
        "pin": 17
      },
      "knob4": {
        "component": "AnalogControl",
        "pin": 20
      },
      "knob5": {
        "component": "AnalogControl",
        "pin": 18
      },
      "knob6": {
        "component": "AnalogControl",
        "pin": 21
      },
        "led1": {
          "component": "Led",
          "pin": 22
        },
        "led2": {
          "component": "Led",
          "pin": 23
        }
      },
      "aliases": {
        "switch": "sw1",
        "switch1": "sw1",
        "switch2": "sw2",
        "switch3": "sw3",
        "switch4": "sw4",
        "switch5": "sw5",
        "switch6": "sw6",
        "switch7": "sw7",
        "encswitch": "encoder_rise",
        "enp": "encoder_press",
        "press": "encoder_press",
        "knob": "knob1",
        "ctrl": "knob1",
        "ctrl1": "knob1",
        "ctrl2": "knob2",
        "ctrl3": "knob3",
        "ctrl4": "knob4",
        "ctrl5": "knob5",
        "ctrl6": "knob6"
  }
}

After that, just learning or tweaking the component’s (switch and knob) reference names was the next step. Hope this helps!

2 Likes

Looks like you have the “som” written as “terrarium”. Maybe try changing that to “seed” and seeing if you can get it to compile.

It’s also worth noting that your pin assignments as written are incorrect. It’s confusing, but your definitions for pins need to correspond with the GPIO pin # of the Daisy Seed, not the physical pin (1-40) of the device. For example; your “knob1” control is mapped to pin 23 but should read pin 17. Physical pin 23 corresponds to GPIO Pin 17.

Hopefully this makes it clear what I’m referring to!

3 Likes

Ahhhhh derrrrr
/facepalm
I think I even knew that once
Thank you both, no doubt I can get it going now

Is the JSON format the same for oopsy and pd2daisy?

I just noticed, this .json file lists 7 switches. Terrarium has only 6, no?

Hey, you’re right. I did a lot of fumbling with the JSON at the beginning, leaving some unnecessary artifacts I guess… Thanks.