3 Switch Pins but 1 Not Updating Vera
-
Having trouble getting the Pro-mini Arduino pins to update my Veralite. As you see the send looks like it should be updating but nothing or maybe I am missing something. In my sketch I am using pins 3,4,5 and pins 3 and 5 are updating fine. I'm running MySensors Plugin V1.4 and API v1.5 and UI7.
#include <MySensor.h> #include <SPI.h> #include <Bounce2.h> #define NUMBER_OF_SWITCHES 3 #define RADIO_ID 88 MySensor gw; Bounce debouncer[NUMBER_OF_SWITCHES]; int oldValue[NUMBER_OF_SWITCHES]; byte switchPin[NUMBER_OF_SWITCHES] = {3,4,5}; //<<<<<<<<<<< set your switch pins here MyMessage msg(RADIO_ID,V_TRIPPED); void setup() { gw.begin(NULL, RADIO_ID, false); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("Garage Node", "1.2c"); for (int i = 0; i < NUMBER_OF_SWITCHES; i++) { pinMode(switchPin[i],INPUT_PULLUP); debouncer[i] = Bounce(); debouncer[i].attach(switchPin[i]); debouncer[i].interval(5); } for (int i = 0; i < NUMBER_OF_SWITCHES; i++) { gw.present(i, S_DOOR); gw.wait(250); } } // void loop() { for (int i = 0; i < NUMBER_OF_SWITCHES; i++) { debouncer[i].update(); int value = debouncer[i].read(); if (value != oldValue[i]) { gw.wait(250); gw.send(msg.setSensor(i).set(value==LOW ? true : false),false); } oldValue[i] = value; } }
-
Have you tried using external pullup resistors instead of the internal?
-
@BulldogLowell Thanks I will try that in the future it's a bit hard SMD resistors.
If you see the last line on the serial monitor it looks to me it appears to be sending the data...right?
-
Yes, looks like it is transmitting.
How SHOULD the visual feedback for door sensor in UI7 behave?
-
-
@akbooer Yes this is what I was seeing on UI7 but nothing on sensor pin for sensor door 1. I was powering it from my USB but I changed it to board(MYS11) power 5v and now it sends the data.
This is good now but now I see delays and some times 2 sensors report both on but only 1 is grounded. I'm not sure if that has to do with debounce timers perhaps?
Suggested Topics
-
💬 Minimal LiPo powered Arduino Pro Mini + RFM95 MySensors node
OpenHardware.io • 24 Mar 2020, 09:18 • openhardware.io 13 Jan 2022, 18:32 -
💬 In-wall scene controller main board
OpenHardware.io • 23 Dec 2017, 23:52 • openhardware.io 23 Dec 2017, 23:52 -
Sudden battery drain - Pro-mini + RFM69
Troubleshooting • 6 Apr 2023, 10:58 • Oumuamua 13 Oct 2023, 23:49 -
Weather station DHT22, BMP185, SI1145
My Project • 13 Sept 2014, 14:01 • jesse 21 Sept 2016, 17:04 -
💬 Extremely Simple Arduino Pro-Mini LoRa Water Leak Detector
OpenHardware.io • 26 Nov 2017, 01:53 • openhardware.io 4 Mar 2018, 16:24 -
Is it possible to turn 5v pro mini into unregulated for low power use?
Troubleshooting • 24 Feb 2016, 19:14 • drock1985 24 Feb 2016, 19:53 -
using 2 interrupt pins (2,3) inside a node.
Development • 10 Mar 2015, 18:34 • Mickey 10 Mar 2015, 21:00 -
💬 Soil Moisture Sensor Pro Mini
OpenHardware.io • 12 Feb 2017, 19:07 • openhardware.io 18 May 2018, 20:26