Adding gate_out_3 to board json

Hello there! Don’t know if this is the right section to talk about it but I’m having the same problem, I’m working with Plug Data tho.

I basically have ADC_12 (pin D8) unused on my patchsm and I’d like to use it to flash a led (my idea is to convert it into a GateOut since I’m also using the already available gate outputs for leds).
So, I replaced ADC_12 section of my json file with what follows (just copied one of the gate_out definitions and changed name):

"gate_out_3": {
			"component": "GateOut",
			"pin": "D8",
			"display": "",
			"default": true
		},

And added "gateout3": "gate_out_3", to the “aliases” section.

I get an “Export Successful” message from the compiler but with the following error as last line (also, patchsm is silent, so not being flashed):

error: 'class daisy::patch_sm::DaisyPatchSM' has no member named 'gate_out_3'; did you mean 'gate_out_1'?
  211 |   dsy_gpio_write(&hardware.som.gate_out_3, output_data[2]);
      |                                ^~~~~~~~~~
      |                                gate_out_1

I’ve had a look at the GateOut section of component_defs_patchsm.json but my line looks totally different from what reported by @teddexter and it looks like this:

“map_init”: “{name}.pin = daisy::patch_sm::DaisyPatchSM::{pin};\n\t\t{name}.mode = {mode};\n\t\t{name}.pull = {pull};\n\t\tdsy_gpio_init(&{name});”,

Do you know how to solve this? Am I missing something?

Hey @sawtooth!

Could you share the entire json file? I want to test if it’s also not working on my end as well. Thanks!

Hi there!
Here it is!
myjson.json.zip (1.3 KB)

Hope to have placed it into the right folder, the plugdata folder structure looks way more complex than the oopsy one to me. Found the json files in

plugdata → toolchain → bin → heavy → hvcc → json2daisy → resources

So I placed my file there.

You can copy, paste, and do Preformatted text for your json on here :slight_smile:
It’ll be faster for everyone to have a look at your json without needing to download.

And as far as I know, it doesn’t matter where you place the json file.

Ops, you’re right, here it is!

{
	"name": "myjson",
	"som": "patch_sm",
	"defines": {},
	"audio": {
		"channels": 2
	},
	"components": {
		"cv_1": {
			"component": "AnalogControl",
			"pin": "C5",
			"default": true
		},
		"cv_2": {
			"component": "AnalogControl",
			"pin": "C4",
			"default": true
		},
		"cv_3": {
			"component": "AnalogControl",
			"pin": "C3",
			"default": true
		},
		"cv_4": {
			"component": "AnalogControl",
			"pin": "C2",
			"default": true
		},
		"cv_5": {
			"component": "AnalogControl",
			"pin": "C6",
			"default": true
		},
		"cv_6": {
			"component": "AnalogControl",
			"pin": "C7",
			"default": true
		},
		"cv_7": {
			"component": "AnalogControl",
			"pin": "C8",
			"default": true
		},
		"cv_8": {
			"component": "AnalogControl",
			"pin": "C9",
			"default": true
		},
		"adc_9": {
			"component": "AnalogControl",
			"pin": "A2",
			"default": true
		},
		"adc_10": {
			"component": "AnalogControl",
			"pin": "A3",
			"default": true
		},
		"adc_11": {
			"component": "AnalogControl",
			"pin": "D9",
			"default": true
		},
		"gate_out_3": {
			"component": "GateOut",
			"pin": "D8",
			"display": "",
			"default": true
		},
		"gate_out_1": {
			"component": "GateOut",
			"pin": "B5",
			"display": "",
			"default": true
		},
		"gate_out_2": {
			"component": "GateOut",
			"pin": "B6",
			"display": "",
			"default": true
		},
		"cvout1": {
			"component": "CVOuts",
			"default": true
		},
		"cvout2": {
			"component": "CVOuts",
			"default": true
		},
		"gate_in_1": {
			"component": "GateIn",
			"pin": "B10",
			"default": true
		},
		"gate_in_2": {
			"component": "GateIn",
			"pin": "B9",
			"default": true
		},
		"sw1": {
			"component": "Switch",
			"pin": "B7"
		},
		"sw2": {
			"component": "Switch",
			"pin": "B8"
		}
	},
	"aliases": {
		"switch": "sw1",
		"switch1": "sw1",
		"switch2": "sw2",
		"button": "sw1",
		"toggle": "sw2",
		"gate": "gate_in_1",
		"gate1": "gate_in_1",
		"gate2": "gate_in_2",
		"gateout": "gate_out_1",
		"gateout1": "gate_out_1",
		"gateout2": "gate_out_2",
		"gateout3": "gate_out_3",
		"cvout": "cvout1",
		"cv_out_1": "cvout1",
		"cv_out_2": "cvout2",
		"knob": "cv_1",
		"knob1": "cv_1",
		"knob2": "cv_2",
		"knob3": "cv_3",
		"knob4": "cv_4",
		"knob5": "cv_5",
		"knob6": "cv_6",
		"knob7": "cv_7",
		"knob8": "cv_8",
		"ctrl": "cv_1",
		"ctrl1": "cv_1",
		"ctrl2": "cv_2",
		"ctrl3": "cv_3",
		"ctrl4": "cv_4",
		"ctrl5": "cv_5",
		"ctrl6": "cv_6",
		"ctrl7": "cv_7",
		"ctrl8": "cv_8"
	}
}

Thanks for the json file :slight_smile:

I didn’t get that error displayed on my end when I compiled using that json file.
I’m on plugdata v0.8.2 if that makes any difference.

It does → plugdata-heavy-toolchain/COMPATIBILITY at main · plugdata-team/plugdata-heavy-toolchain · GitHub

1 Like

This is unnecessary, you should be able to select your json file from anywhere on the filesystem.
I’d recommend against doing this because on the next toolchain update your files will be erased.

The syntax in your json is using some unsupported features. Things like "display": "" and "default": true are not used by json2daisy.

The problem however is that you can’t just use any pin as “GateOut”, but there is a dedicated list in the internal library:

Removed the "display": "" and "default": true lines and it works!! And thanks a lot for the json location tip, I’ll definitely move it into a separate folder on my desktop.

Thanks!

1 Like