Author Topic: Reading two sensor at the same time  (Read 3394 times)

tmsio

  • RFduino Jr. Member
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Reading two sensor at the same time
« Reply #15 on: September 14, 2016, 11:25:23 PM »
So you are saying with your resistor network and pullups to 5V doesn't work when triggering both on HIGH instead of LOW.

Good morning Tolson,
                                       yes it doesn t work with my resistor chain.
At moment i removed my resistor chain and i use only internal pull up but the result appear the same.
Maybe some short cut or i don t know... i tested it.
This evening i ll try a different board using the default resistor chian ad after if doesn' t work i ll try to remove the chian resistor again triggering both on HIGH.
I ll post the output.
Thank You Again.
Regards
Emiliano

« Last Edit: September 14, 2016, 11:33:37 PM by tmsio »

tmsio

  • RFduino Jr. Member
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Reading two sensor at the same time
« Reply #16 on: September 15, 2016, 06:44:16 AM »
Tested another board.... same issue....

tolson

  • Global Moderator
  • *****
  • Posts: 866
  • Karma: +20/-0
    • View Profile
    • Thomas Olson Consulting
Re: Reading two sensor at the same time
« Reply #17 on: September 15, 2016, 12:43:18 PM »
The results I gave uses the RGB shield. The buttons are on GPIO 5 and 6. So I use your sketch with GPIO changed from 2,3 to 5,6.
And there is definitely something wrong with the library when at least one of the triggers is set LOW.; as far as I can tell. Since I don't have access to the RFduino/Simblee source code, I sent the sketch and results we are getting to RF digital.

Code: [Select]
#include <RFduinoBLE.h>
volatile int wCnt = 0;
volatile int cCnt = 0;


int cISR(uint32_t ulPin) {
  cCnt++;
  return 0;
}

int wISR (uint32_t ulPin) {
  wCnt++;
  return 0;
}

void setup() {
  Serial.begin(9600);
  pinMode(5, INPUT);
  pinMode(6, INPUT);
 
  RFduino_pinWakeCallback(6, HIGH, cISR);
  RFduino_pinWakeCallback(5, LOW, wISR);

}

void loop() {

  RFduino_ULPDelay (1000); //loop 1 second interval
  {
    Serial.print(wCnt);
    Serial.print(' ');
    Serial.println(cCnt);
    wCnt = 0;
    cCnt = 0;
  }
}

Can some of the community load this code with their RGB shield and see if they have issues.

tmsio

  • RFduino Jr. Member
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Reading two sensor at the same time
« Reply #18 on: September 15, 2016, 01:05:33 PM »
Hi Tolson, one last question...
It s important for our statup.
If i romove all resistor and if i set both triger to HIGH.... the sensor will send correct signal?
If yes, tomorrow i ll contact my engineer and i ask to him to modify all the future board.
Have you got some advice ?

Thank you so much!!

Regards
Emiliano

tolson

  • Global Moderator
  • *****
  • Posts: 866
  • Karma: +20/-0
    • View Profile
    • Thomas Olson Consulting
Re: Reading two sensor at the same time
« Reply #19 on: September 15, 2016, 02:00:47 PM »
All I can say is it is working for me with both set to trigger on HIGH. YMMF with your setup. You should test designs before committing production changes.

tmsio

  • RFduino Jr. Member
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Reading two sensor at the same time
« Reply #20 on: September 15, 2016, 11:03:26 PM »
Thank you Tolson :)
Regards

Emiliano

tmsio

  • RFduino Jr. Member
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Reading two sensor at the same time
« Reply #21 on: September 18, 2016, 01:28:06 AM »
Hi Tolson, i have two hall effect rotary sensor....
If i blowing into the two sensors no problem...
After too much test, it appear that when the magnetic palette (inside the sensor1)  stopping below the hall sensor, the signal is alway HIGH and the other sensor2 does t work... if i move the magnet (sensor1)  blowing in the sensor the other sensor work fine...and vice versa.
It s possible?
Can i modify my sketch resetting the pin state or something like this?

Regards

Emiliano




tmsio

  • RFduino Jr. Member
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Reading two sensor at the same time
« Reply #22 on: September 20, 2016, 12:59:50 AM »
Someone, can try this sketch and during the test try  hold down the botton 1 and push repeatedly the second button.
And vice versa.

Thank You
Emiliano