<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[APDS9960 - Gesture Sensor and MySensors Sleep]]></title><description><![CDATA[<p dir="auto">I'm trying to build a gesture sensor switch using adps9960 module that runs on battery and also accommodates temp/humidity via dht11.</p>
<p dir="auto">Setup works with examples provided with Sparkfun library - so electronics ok. I see the gesture sensor activate interrupt 0 from pro-mini 3.3v. Device works fine in non-sleep mode as MySensors to <a href="http://Webthings.io" rel="nofollow ugc">Webthings.io</a></p>
<p dir="auto">Sleep mode using the interrupt and FALLING only wakes after ms sleep, not from interrupt activity.<br />
The difference between example code and MySensor example code <a href="https://www.mysensors.org/download/sensor_api_20#sleeping" rel="nofollow ugc">https://www.mysensors.org/download/sensor_api_20#sleeping</a> is</p>
<ol>
<li>No allocation of INPUT pin for interrupt pin - assume its done in MySensors</li>
<li>No specification of attach interrupt - assume its done in MySensors</li>
<li>No definition of an ISR - again assume its done in MySensors</li>
</ol>
<p dir="auto">Anyone had success with this - the adps 9960 sets off the interrupt - tested by the Sparkfun example code ... device tech specs says it pulls low after an action detected on the proximity sensor engine..</p>
]]></description><link>https://forum.mysensors.org/topic/11731/apds9960-gesture-sensor-and-mysensors-sleep</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 07:19:24 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/11731.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Jun 2021 08:31:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to APDS9960 - Gesture Sensor and MySensors Sleep on Thu, 01 Jul 2021 13:45:58 GMT]]></title><description><![CDATA[<p dir="auto">I did more investigation played around with sleep outside of mysensors and found a bit of code in a proximity sensor example:</p>
<pre><code>    // Reset flag and clear APDS-9960 interrupt (IMPORTANT!)
  isr_flag = 0;
  if ( !apds.clearProximityInt() ) {
      Serial.println("Error clearing interrupt");
  }
</code></pre>
<p dir="auto">I then needed to play around with delays to allow the sensor to catchup..</p>
<pre><code>void loop() {
delay(1000);
</code></pre>
<p dir="auto">Recoding back to MySensors</p>
<pre><code>if ( !apds.clearProximityInt() ) {
      Serial.println("Error clearing interrupt");
  }
  wakeupReason = sleep(digitalPinToInterrupt(INT_PIN), FALLING, sleepTime);
</code></pre>
<p dir="auto">setting up the interrupt pin with a pullup forced the FALLING when pin dragged down by the sensor.</p>
<pre><code>void setup() {
    pinMode(INT_PIN, INPUT_PULLUP);
</code></pre>
<p dir="auto">All this is on caveat it makes it through some more testing.</p>
]]></description><link>https://forum.mysensors.org/post/110544</link><guid isPermaLink="true">https://forum.mysensors.org/post/110544</guid><dc:creator><![CDATA[Westie]]></dc:creator><pubDate>Thu, 01 Jul 2021 13:45:58 GMT</pubDate></item></channel></rss>