Giter Site home page Giter Site logo

seeed-ardupy-lis3dhtr's Introduction

Seeed ArduPy LIS3DHTR Build Status

Introduction

An ArduPy library for 3-Axis Digital Accelerometer ±2g to 16g (LIS3DHTR).Acceleration data can be obtained using IIC interface.

How to binding with ArduPy

pip3 install aip
  • Build firmware with Seeed ArduPy LIS3DHTR
aip install https://github.com/Seeed-Studio/seeed-ardupy-lis3dhtr
aip build
  • Flash new firmware to you ArduPy board
aip flash [Ardupy Bin PATH]

For more examples of using AIP, please refer to AIP.

Usage

from machine import Map
from arduino import grove_lis3dhtr
lis = grove_lis3dhtr()
#lis = grove_lis3dhtr(Map.WIRE1)  #Specify wire 
while True:
    if lis.avaiable():
        print("X: ", lis.x)
        print("Y: ", lis.y)
        print("Z: ", lis.z)

API Reference

  • available(void) : bool - available
if lis.available():
    print("X: " + lis.x)
  • setPoweMode(mode<uint8_t>) : void - set power mode
# Set power mode
lis.setPoweMode(0) #POWER_MODE_NORMAL 
lis.setPoweMode(1) #POWER_MODE_LOW 
  • setFullScaleRange(range<uint8_t>) : void - set full scale range
lis.setFullScaleRange(0) # LIS3DHTR_RANGE_2G 
lis.setFullScaleRange(1) # LIS3DHTR_RANGE_4G
lis.setFullScaleRange(2) # IS3DHTR_RANGE_8G
lis.setFullScaleRange(3) # LIS3DHTR_RANGE_16G
  • setOutputDataRate(rate<uint8_t>) : void - set output data rate
lis.setOutputDataRate(0) # LIS3DHTR_DATARATE_POWERDOWN 
lis.setOutputDataRate(2) # LIS3DHTR_DATARATE_10HZ
lis.setOutputDataRate(3) # LIS3DHTR_DATARATE_25HZ
lis.setOutputDataRate(4) # LIS3DHTR_DATARATE_50HZ
lis.setOutputDataRate(5) # LIS3DHTR_DATARATE_100HZ
lis.setOutputDataRate(6) # LIS3DHTR_DATARATE_400HZ
lis.setOutputDataRate(7) # LIS3DHTR_DATARATE_400HZ
lis.setOutputDataRate(8) # LIS3DHTR_DATARATE_1_6KH
lis.setOutputDataRate(9) # LIS3DHTR_DATARATE_5KHZ
  • setHighSolution(rate<bool>) : void set high solution
lis.setHighSolution(True) # HighSolution enable
lis.setHighSolution(False) # HighSolution disable
  • openTemp(void) : void - open temperature enable
lis.openTemp()
  • closeTemp(void) : void - close temperature enable
lis.closeTemp()
  • x : float - get acceleration z
x = lis.x
  • y : float - get acceleration y
y = lis.y
  • z : float - get acceleration z
z = lis.z
  • adc1 : uint16_t - get adc channle 1
adc1 = lis.adc1
  • adc2 : uint16_t - get adc channle 2
adc2 = lis.adc2
  • adc3 : uint16_t - get adc channle 3
adc3 = lis.adc3
  • temperature : uint16_t - get temperature
temperature = lis.temperature

License

This software is written by seeed studio
and is licensed under The MIT License. Check License.txt for more information.

Contributing to this software is warmly welcomed. You can do this basically by
forking, committing modifications and then pulling requests (follow the links above
for operating guide). Adding change log and your contact into file header is encouraged.
Thanks for your contribution.

Seeed Studio is an open hardware facilitation company based in Shenzhen, China.
Benefiting from local manufacture power and convenient global logistic system,
we integrate resources to serve new era of innovation. Seeed also works with
global distributors and partners to push open hardware movement.

seeed-ardupy-lis3dhtr's People

Contributors

lynnl4 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

crazyhackelkorn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.