# Use LIS3DH with Electron

**URL:** https://community.particle.io/t/use-lis3dh-with-electron/26010
**Category:** General
**Created:** [September 22, 2016, 6:58am UTC](https://community.particle.io/t/use-lis3dh-with-electron/26010 "2016-09-22T06:58:45Z")
**Posts on this page:** 1
**Showing post:** 37

<div class="post-metadata">

### Author: ![RWB](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rwb/32/22599_2.png) [@RWB](https://community.particle.io/u/RWB)
#### Post date: [July 26, 2017, 3:44pm UTC](https://community.particle.io/t/use-lis3dh-with-electron/26010/37 "2017-07-26T15:44:35Z")

</div>

@rickkas7 I got everything working on the i2c bus using your Asset Tracker library 🙂

It’s nice to have a quality Accelerometer to add to my box of tools.

I did notice one line that I think needs to be changed regarding the GPS positioning.

In the GPS Wait State case you have ` if (gps.location.isValid()) {`

 ![](https://us1.discourse-cdn.com/flex026/uploads/particle/original/2X/0/07d29fc65615a4d434167f03cf944c43289bb78d.png) 

I noticed that the program would constantly use the previous GPS Fix location data even though it had zero satellites in view. If I would have moved the GPS unit it would have still used the old GPS position data even though I was someplace different.

I looked this up and others noticed the same issue with the gps.location.isValid() command.

Here is a way to force the code to get a new GPS fix if the old GPS position data is older than a preset threshold.

 ![](https://us1.discourse-cdn.com/flex026/uploads/particle/original/2X/4/4b14898194b0c576ddda22b16ca4d46e107d75d8.png)

 ![](https://us1.discourse-cdn.com/flex026/uploads/particle/original/2X/6/61d4ea76bef4e19230d74ff5b7b8cde9530f3c67.png)

---

_[View the full topic](https://community.particle.io/t/use-lis3dh-with-electron/26010)._
