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
-
Weather station DHT22, BMP185, SI1145
My Project • 13 Sept 2014, 14:01 • jesse 21 Sept 2016, 17:04 -
💬 Arduino Pro Mini IO Shield
OpenHardware.io • 13 Dec 2017, 05:59 • openhardware.io 13 Dec 2017, 09:53 -
BME280 failing to initialize after spikes in readings
Troubleshooting • 6 Feb 2017, 15:04 • gogopotato 7 Feb 2017, 00:20 -
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Battery level don't show up
Troubleshooting • 10 Dec 2014, 20:06 • cheesepower 14 Dec 2014, 19:21 -
Trouble flashing Arduino Pro Mini with a sketch
Hardware • 29 Nov 2014, 13:05 • CaptainZap 9 Dec 2014, 19:56 -
Removing pro mini led bricked the board
Hardware • 29 Feb 2016, 20:40 • tripy 29 Oct 2017, 20:45