Is this a bug or something I'm doing?

Made a custom board for patch sm. Using a custom json for extra pins. Couldn’t get gate outs to work so far, but that’s another story. Had success with switches though. Leds give me error on compile…

“oopsy-verbose: “Untitled1_patch_mine.cpp:61:48: error: no matching function for call to ‘daisy::Led::Init(const dsy_gpio_pin&)’”
oopsy-verbose: " 61 | led1.Init(daisy::patch_sm::DaisyPatchSM::D8), true);”
"

The text I’ve added to Json is very straightforward…
“led1”: {
“component”: “Led”,
“pin”: “D8”
}

In the .cpp file in the build folder lines have been generated, but first line looks strange to me, ie 1 open bracket and 2 closed ones.

/ LEDs
led1.Init(daisy::patch_sm::DaisyPatchSM::D8), true);
led1.Set(0.0f);

Any idea what’s happening here and how to get round it? Thanks.

Ok found the problem in
component_defs_patchsm.json

“map_init”: “{name}.Init(daisy::patch_sm::DaisyPatchSM::{pin}),{invert});\n\t\t{name}.Set(0.0f);”,

after “{pin}” the closed bracket shouldnt be there. Remove that and it works.

Dont know if I’d call that a bug but it’s an error in the json file that I downloaded from the sensors update branch,

When I say worked above. It compiled but I still cant get led to flash.

I should say im working with oopsy gen. I forget to mention this as i get overly absorbed in my current thing.

I managed to get an LED flashing today with some edits to the patch sm related files in libdaisy. and by using a gate out. I wonder if I’m picking up the wrong resources somehow, but anyway it works now as far as I can tell, so I think I have what I need.

I get the feeling maybe the seed is further on in terms of implementation for custom pins than the patch_sm? If anybody needs more details let me know. Or if you know why I’m an idiot and how I can do it all in just the json, I’d love to know that also :slight_smile:

No that’s definitely a bug! Thanks for posting those details. I’ve made a patch which should be merged into the codebase soon to fix this (simply removing that extra bracket). If you want the Led component to work on your local Oopsy in the meantime, you could just remove that bracket yourself in the component_defs_patchsm.json file.

Thanks :slight_smile:

1 Like

thanks for pointing this stuff. I have patch.sm as well and i would love to know about any changed you had to make.

Hi, For Leds I made the change above, ie removed a surplus bracket from below file…
component_defs_patchsm.json

“map_init”: “{name}.Init(daisy::patch_sm::DaisyPatchSM::{pin}),{invert});\n\t\t{name}.Set(0.0f);”,

after “{pin}” the closed bracket shouldnt be there. Remove that and it works.

However I have to say that I could then compile ok, but my Leds didnt flash. Also I couldnt get gate outs to work originally but I found a little hack now, so I use gate_outs for Leds anyway. The need for the hack could be due to me not doing something else properly though (as a newb), so I would suggest if you need to access any of the addtional digital IO, then go through the route described by the Oopsy creator guys (I search for oopsy custom json) and if that doesn’t work, then let me know. Creating new “Switches” in a custom json worked fine for me and gave me no trouble at all by the way.