ZStarLib FreeFall + Auto connexion

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ZStarLib FreeFall + Auto connexion

466 Views
Arnos
Contributor I

Hello, I'm trying to make the freefall detection working into my zstar app.

My app is based on the example, I added into the constructor :

 

m_theZStar.OnFreeFall += new ZStar3.OnFreeFallHandler(theZstar_OnFreeFallHandler );
m_theZStar.FreeFallEventEnableAll(1);

 

And actually the Handler isn't called on freefall...

Note that I :

- desactivated the burst mode (using a timer instead to retrieve the values regularly)

- tried to call IonSetControlMode()

- tried to activate freefall directly onto the sensor instance

 

I really don't understand why I doesn't work, since I saw another post on this forum where someone did the same and succeed without any problem.

 

Another question :

 

In the ZStar GUI, a sensor which was already connected to the usb stick before is automatically detected when the app start.

In the ZStarLib example, this is not the same, the sensor has to be linked to the usb stick after the connexion on the COM port occur.

I tried to force call theZStar_OnActiveSensorsChanged(null, 0);  into  bt_OpenPort_Click(object sender, EventArgs e) but it didnt make it.

One weird thing, when the sensor is already connected to the usb stick before I start my app, the ActiveSensorsCount is equal to zero (the led on the sensor is blinking fast)

How to obtain the same result as in Zstar gui ?

 

Thx for your answers.

Labels (1)
0 Kudos
1 Reply

166 Views
Gargy
NXP Employee
NXP Employee

Hello,

 I don't see the zstarlib for ages, but as I remmember the burst mode should be enabled and the sesnor should be set in basic range typically 1.5-2g.

Second question is one from good ones :smileyhappy:

 

I check the source code of ZSTAR GUI and I found that the main magic is call method :theZStar.GetZStarConfiguration(true); with true parameter (as I hope).

 

Have a nice day

 

 

0 Kudos