I'm working on a Pd-based Bela Mini thing, with buttons and knobs connected to the analog/digital pins on the Bela. I'm wondering whether there is a way for the initial state of switches to be applied to the Pd patch on startup - like, if a switch is "on" when the Bela turns on, can the digital pin read that and send it to Pd?

Currently I am finding that I need to flip a switch once before the state is read in the patch. Does that make sense?

    yannseznec I'm wondering whether there is a way for the initial state of switches to be applied to the Pd patch on startup - like, if a switch is "on" when the Bela turns on, can the digital pin read that and send it to Pd?

    I've checked this recently and I think that if the reading is 0 you get nothing, but if the reading is 1, then you do get a message on start to tell you that it's 1. Can you verify that this is the case for you, too? It it is, then you can work on the assumption of a default 0 which can be overridden by the 1 message on startup if appropriate.

      giuliomoro sorry for the delay getting to this, I finally managed to test it today. Yes, your solution works great. I have put a loadbang->1 on all of my switches now. When the Bela starts up it will either leave these on (which means the switch is on) or it will switch them off because the switch is off. Thanks!

      I would have expected the opposite actually: [loabdang]--[0( ... ?