Daisy pod additional buttons

hi everyone,

is it possible to hook up additional buttons to the pod?

there are pins named ss, sck, m1, m0, scl, sda
can any of these be configured as digital inputs?

thanks

Hey wilkins!

Yes, you can use those pins as a simple digital input pins for buttons.

hi takumi,
thanks!
in the meantime i found this:
https://static1.squarespace.com/static/58d03fdc1b10e3bf442567b8/t/63e2eb14c0085e36812cc1e0/1675815701844/Daisy_Seed_datasheet_v1.0.5.pdf

the document shows among others all the peripherial GPIO pin numbers and names.

1 Like

good morning,
now that i have 2 additional buttons connected to the pins sda,scl.
is it possible to extend the daisy_pod.h with
…
BUTTON_3
BUTTON_4

so i could handle them like the 2 original buttons on the pod?
like:
pod.buttons[3].Pressed()
pod.buttons[3].Pressed()

good morning, wilkins!

You would also need to edit the daisy_pod.cpp that’s in the same folder to add those 2 buttons.
So you would need to add…

#define SW_3_PIN 11

#define SW_4_PIN 12

or something along that line. It’s worth keeping in mind that people are going to use those available pins differently than you.

And you also need to edit void DaisyPod::ProcessDigitalControls() and void DaisyPod::InitButtons()

And don’t forget to edit the /** Public Members */ section in daisy_pod.h.

Once edited, I believe you need to rebuild the libraries and then you should be all set to go!

OMG!
think i better go back to bed:)

It didn’t look too bad to edit those :slight_smile: And I’ll be right here if you run into any issues. I can also put it together since I got some fresh new buttons.

I also recommending just treating the hardware you have as a Daisy Seed with two buttons connected to those pins. And flash the seed’s Button example (you’ll have to edit pin 28 to 12 and such).
The purpose of doing this is to make sure that the hardware is hooked up all correctly before you start editing all of those files for Pod. That way, if things aren’t working after editing those two files, you can be pretty certain that it’s a software issue.

Good luck!

thanks for hinting me to the B u t t o n example.
unfortunately it won’t compile.
on line 17:
button.Init(1000, true, 28);
there should be a 4th parameter: Mode.

do you have an idea what those modes are?

is the Switch class documented anywhere?

edit:
in my code i added 0 as a fourth parameter and it works.
but still interested what modes are available

You have the source code for this.

it’s the Button example for seed

You have the source code for libDaisy, where you’ll find all the implementation details.

Also, see:
https://electro-smith.github.io/libDaisy/classdaisy_1_1_daisy_pod.html#a148bfabd288f0b4d20a26b1d0e3bdeeba80faba4f339fbf6d575d3f0840c6269e

Is your copy of the DaisyExamples repository up-to-date?

The following line doesn’t look like what I have in DaisyExambles/seed/Button/Button.cpp
“button.Init(1000, true, 28);”

sorry, i didn’t mention it’s the button.ino example. in arduino
…/Arduino/libraries/DaisyDuino/examples/Seed/Button

Oops, I should have thought of that.
So, libDaisy documentation doesn’t apply, but you have the source code for DaisyDuino.
Without looking, my guess is that the other argument is pull-up Mode.

The main point is, the source code is the most detailed documentation for Daisy.

your guess is right:)
it accepts INPUT_PULLUP as a fourth argument