Hello. I’m trying to conect a push button to a digital entrance, so that if i push it, it will send a “T” to the cloud. If I don’t push it, it will send an “N”. The problem is that i’m not sure if the dash is actually reading the entrance, or if I need to declare the pin as an entrance and how to do it. I hope you can help me.
We’ll see if we can help. Can you post some info on the hardware you’re using?
It’s a simple push button conected to pin D16 (L10 on the board). It’s also conected to USB 5V and ground, so that when I push the button, the circuit closes and send the voltage to pin D16
I also conected a LED to see whe the button is pushed
So it sounds like you would write a program that polls for the state of the button and then does some action. It works the same as it would on an Arduino so a good starting point is probably here: https://www.arduino.cc/en/Tutorial/StateChangeDetection or https://www.arduino.cc/en/Tutorial/Button
It worked. Thank you. But I have another question: is there any web page or pdf that you have with the functions of the dash library? I’m specifically looking for one that turns the dash off when i push a button, and then turns it on when i push it again.
Right now everything is here: https://community.konekt.io/t/using-the-dash-class/232
I don’t think we have that kind of functionality right now though.
how do you configure IO pins as a wake up pin?
For deepSleep and shutdown, you need to set the appropriate wake-up pins using Dash.attachWakeup(wakeupPin, mode);
where wakeupPin is an IO pin that supports wake up (Check that the pin has an entry in the WKUP column of the pinout diagram in the Operation Manual https://content.konekt.io/docs/hardware/konekt-dash/manual/), and mode is RISING, FALLING or CHANGE.
Here is a simple sketch that configures R04 as an input with a pull-down. R04 is used as a wake-up source when a rising edge is detected. The LED is on for 5 seconds at start, then deep sleeps (which turns off the LED). Make a connection between R04 and R01 (VBATT) and the Dash will wake, turn on the LED for 1 second, then return to deep sleep.
void setup() {
pinMode(R04, INPUT_PULLDOWN);
Dash.begin();
Dash.attachWakeup(R04, RISING);
Dash.onLED();
Dash.snooze(5000);
}
void loop() {
Dash.deepSleep();
Dash.onLED();
Dash.snooze(1000);
}