FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    How to use H3Lis331DL and Raspberry Pivotable Acceleration

     

    Step 1: Hardware Required: Material to achieve the desired target includes the following hardware components: 1. H3LIS331DL 2. Raspberry Pi 3. I2C cable 4. Raspberry Pi Shield of I2C 5. Ethernet cable Step 2: Hardware connection: "Hardware connection" between the sensor section and substantially illustrates the wiring connection raspberry pi required. On any system to the desired output, to ensure proper connection is a basic need. Thus, the necessary connections are as follows: H3LIS331DL will run on I2C. This is a wiring diagram of an example that demonstrates how to connect each of the sensor interfaces. Out of the box, the board is configured to use the I2C interface, so if you are not sure, we recommend using this connection. You only need four wires! Vcc, Gnd, SCL and SDA pins requires only four connections, and these are connected by the connection cable I2C. These connections in the picture above has been on display. Step 3: Python code to acceleration measurements: "The advantage of using Raspberry Pi is that it provides a flexible programming language for you, you can use the programming language of the circuit board so that the sensor is connected to it. Take advantage of this development board, we are here to demonstrate their programming in python. Python syntax is one of the easiest most simple programming language. H3LIS331DL python code can be downloaded from our github community DCUBE Store. For your convenience, we are still here interpreted code: As the first step is coded using python, SMBus need to download the library because the library support used in the code. Therefore, to download the library, you can visit the following link: https://pypi.python.org/pypi/smbus-cffi/0.5.1 You can copy the code to work here, too: import smbus import time # Get I2C busbus = smbus.SMBus (1) # H3LIS331DL address, 0x18 (24) # Select control register 1, 0x20 (32) # 0x27 (39) Power ON mode, Data output rate = 50 Hz # X, Y, Z-Axis enabled bus.write_byte_data (0x18, 0x20, 0x27) # H3LIS331DL address, 0x18 (24) # Select control register 4, 0x23 (35) # 0x00 (00) Continuous update, Full scale selection = +/- 100g bus.write_byte_data (0x18, 0x23, 0x00) time.sleep (0.5) # H3LIS331DL address, 0x18 (24) # Read data back from 0x28 (40), 2 bytes # X-Axis LSB, X-Axis MSB data0 = bus.read_byte_data (0x18, 0x28) data1 = bus.read_byte_data (0x18, 0x29) # Convert the dataxAccl = data1 * 256 + data0 if xAccl "32767: xAccl - = 65536 # H3LIS331DL address, 0x18 (24) # Read data back from 0x2A (42), 2 bytes # Y-Axis LSB, Y-Axis MSB data0 = bus.read_byte_data (0x18, 0x2A) data1 = bus.read_byte_data (0x18, 0x2B) # Convert the data yAccl = data1 * 256 + data0 if yAccl "32767: yAccl - = 65536 # H3LIS331DL address, 0x18 (24) # Read data back from 0x2C (44), 2 bytes # Z-Axis LSB, Z-Axis MSB data0 = bus.read_byte_data (0x18, 0x2C) data1 = bus.read_byte_data (0x18, 0x2D) # Convert the data zAccl = data1 * 256 + data0 if zAccl "32767: zAccl - = 65536 # Output data to screen print "Acceleration in X-Axis:% d"% xAccl print "Acceleration in Y-Axis:% d"% yAccl print "Acceleration in Z-Axis:% d"% zAccl The code is performed using the following command: $ "Python H3LIS331DL.py gt; python H3LIS331DL.py The output of the sensor as shown above, for reference. Step 4: Application: The same accelerometer like H3LIS331DL often discovers its application in the game and displays the configuration file switch. The sensor module is also used in the advanced power management system for mobile applications. H3LIS331DL is a three-axis digital acceleration sensor, which is integrated with a smart-on-chip motion trigger interrupt controller. Editor in charge: WV, read full text

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us