Products for USB Sensing and Control
It is currently Thu May 23, 2013 4:11 am

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sun Jul 04, 2010 12:01 pm 
Offline
Phidgetsian

Joined: Sun Jul 04, 2010 11:55 am
Posts: 10
Hello!

Basically for test purposes i run:

Code:
      interfaceKit.addSensorChangeListener(new SensorChangeListener() {
         public void sensorChanged(SensorChangeEvent se) {
            switch (se.getIndex()) {
               case (tempSensorPort):
                  System.out.println("Temperature changed: " +se.getValue()+ " C");
and so on...


The temperature comes from a 1125 (Humidity/Temperature) sensor. I have also a lightsensor, and all three are in the switch. However, only humidity and light is causing calling sensorChanged.
If i run interfaceKit.getSensorValue(temperatureSensorPort), it reads the temperature.

So the problem is only that the sensor does not call sensorChanged. Is this a hardware issue?


Top
 Profile Send private message  
 
PostPosted: Mon Jul 05, 2010 1:23 pm 
Offline
Phidget Mastermind

Joined: Mon Sep 28, 2009 9:04 am
Posts: 464
What's your sensor change trigger value? It's possible the temperature isn't changing enough to trigger an event.


Top
 Profile Send private message  
 
PostPosted: Tue Jul 06, 2010 3:34 pm 
Offline
Phidgetsian

Joined: Sun Jul 04, 2010 11:55 am
Posts: 10
Aha, that is probably why it not reporting. I see the default triggervalue is 10. Will test later and see :)


Top
 Profile Send private message  
 
PostPosted: Tue Jul 06, 2010 4:29 pm 
Offline
Phidget Mastermind

Joined: Mon Sep 28, 2009 9:04 am
Posts: 464
Yeah, the default value is usually a little too large for the temperature sensors. I believe a change of 10 corresponds to something like a 4 degree temperature sensor change.


Top
 Profile Send private message  
 
PostPosted: Wed Jul 07, 2010 1:12 pm 
Offline
Phidgetsian

Joined: Sun Jul 04, 2010 11:55 am
Posts: 10
You are correct. Set triggervalue to 1, and it works perfectly :)


Top
 Profile Send private message  
 
PostPosted: Fri Sep 16, 2011 7:44 am 
Offline
Fresh meat

Joined: Thu Sep 15, 2011 5:53 am
Posts: 1
Sorry can you show me you set the trigger value of sensor by Phidgets sensor manager or in you program?


Top
 Profile Send private message  
 
PostPosted: Fri Sep 16, 2011 8:15 am 
Offline
King of the Lab

Joined: Fri Mar 06, 2009 12:42 pm
Posts: 443
Location: Calgary, Canada
Under the Programming Link above and in the Java-->API Reference section, the InterfaceKitPhidget class has a method called setSensorChangeTrigger and would be used something like

Code:
ifkit.setSensorChangeTrigger(0,1);


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group