Accessing adc 9-12 with gen/oopsy

Hi,

Anyone know the naming convention in gen~/oopsy for pots connected to the Daisy SM adc 9-12 pins? I tried cv9, cv10, cv11, cv12, as well as adc_9, etc, and adc9, and can’t seem to get them to work. For context, I’m using the 3v3 pin and the gnd pin for the other two leads on the pot. Thanks!

Welcome @modularity!

What does your json file look like? Or are you selecting Patch.Init() as the board?

You can set those pins like this and it should work:


        "adc_9": {
			"component": "AnalogControl",
			"pin": "A2",
			"is_default": true
		},
		"adc_10": {
			"component": "AnalogControl",
			"pin": "A3",
			"is_default": true
		},
		"adc_11": {
			"component": "AnalogControl",
			"pin": "D9",
			"is_default": true
		},
		"adc_12": {
			"component": "AnalogControl",
			"pin": "D8",
			"is_default": true
		},

Thank you Takumi- it’s nice to meet you.

I am using oopsy.patch_sm in Max to program the Daisy Submodule using gen~, for a custom module I developed. I have no problems accessing cv1-9 with param declarations in gen~, but would like to have four more potentiometers using the adc_9 - 12 pins.

I looked at the json file and am not sure where to add the code you suggested. Even so, how would I upload a custom json file to the Daisy since it’s likely that oopsy would rewrite a new json every time it is flashed in Max?

Thanks again for your help. Copied below is my json file for a cycle controlled by [param adc_9 @min 50 @max 1000] and sent to out1.

{
	"class": "Module",
	"id": "node_2357",
	"inlets": {
		
	},
	"outlets": [
		{
			"assist": "out1"
		}
	],
	"imports": {
		
	},
	"functions": {
		
	},
	"block": {
		"class": "Block",
		"id": "node_2372",
		"children": [
			{
				"class": "Declaration",
				"id": "node_2359",
				"name": "adc_9",
				"inputs": [
					{
						"class": "Constant",
						"id": "node_2360",
						"value": "0",
						"eval": 0,
						"type": "constant int",
						"source": "box: [param adc_9 0 @max 1000 @min 50] => adc_9"
					}
				],
				"attributes": {
					"max": {
						"class": "Attribute",
						"id": "node_2361",
						"name": "max",
						"value": {
							"class": "Constant",
							"id": "node_2330",
							"value": "1000",
							"eval": 1000,
							"type": "constant int",
							"source": "1:19 -> 1:23"
						}
					},
					"min": {
						"class": "Attribute",
						"id": "node_2362",
						"name": "min",
						"value": {
							"class": "Constant",
							"id": "node_2332",
							"value": "50",
							"eval": 50,
							"type": "constant int",
							"source": "1:29 -> 1:31"
						}
					}
				},
				"type": "control t_sample",
				"typename": "Param",
				"source": "box: [param adc_9 0 @max 1000 @min 50] => adc_9"
			},
			{
				"class": "Statement",
				"id": "node_2363",
				"inputs": [
					{
						"class": "Expression",
						"id": "node_2364",
						"operator": "cycle",
						"inputs": [
							{
								"class": "Variable",
								"id": "node_2365",
								"name": "adc_9",
								"type": "control t_sample",
								"source": "box: [cycle $in1] => cycle_48,cycleindex_49"
							}
						],
						"attributes": {
							
						},
						"type": "signal t_sample",
						"source": "box: [cycle $in1] => cycle_48,cycleindex_49"
					}
				],
				"outputs": [
					{
						"class": "Variable",
						"id": "node_2366",
						"name": "cycle_48",
						"type": "signal t_sample",
						"source": "box: [cycle $in1] => cycle_48,cycleindex_49"
					},
					{
						"class": "Variable",
						"id": "node_2367",
						"name": "cycleindex_49",
						"type": "signal t_sample",
						"source": "box: [cycle $in1] => cycle_48,cycleindex_49"
					}
				],
				"source": "box: [cycle $in1] => cycle_48,cycleindex_49"
			},
			{
				"class": "Statement",
				"id": "node_2368",
				"inputs": [
					{
						"class": "Variable",
						"id": "node_2369",
						"name": "cycle_48",
						"type": "signal t_sample",
						"source": "box: [out 1 $in1] => "
					}
				],
				"outputs": [
					{
						"class": "Variable",
						"id": "node_2370",
						"name": "out1",
						"type": "signal t_sample",
						"source": "box: [out 1 $in1] => "
					}
				],
				"source": "box: [out 1 $in1] => "
			}
		]
	},
	"source": "patcher: gen.patcher 0x1216fcfc0 graph 0x600000b57570"
}

You can select patch_init as your selected board and the ADC should work :slight_smile:

And please make sure to connect AGND and DGND together.

Edit: Ah I see, the previous version doesn’t have the Patch.Init() as the selected board and the Patch SM json file doesn’t seem to include the CV9-12, I believe.
I think the easiest and quickest solution is for you to use the pre-release of the new version of Oopsy!

Please make sure that you make backups of your project.

Thank you @Takumi_Ogata! I will try that over the weekend. In the meantime, I just wanted to clarify what you meant by “connect AGND and DGND together”- do you mean to connect pins A4 and A7 on the submodule, or is there a ground pin in the D pin cluster as well?

My bad! I forgot that you don’t need to do this with Patch SM.