Joy-it SEN-MMA8452Q Bedienungsanleitung

Lesen Sie kostenlos die 📖 deutsche Bedienungsanleitung für Joy-it SEN-MMA8452Q (6 Seiten) in der Kategorie niet gecategoriseerd. Dieser Bedienungsanleitung war für 8 Personen hilfreich und wurde von 2 Benutzern mit durchschnittlich 4.5 Sternen bewertet

Seite 1/6
www.joy it.net-
Pascalstr. 8 47506 Neukirchen Vluyn-
3 AXSIS DIGITAL ACCELERATION SENSOR MODULE-
SEN MMA5482Q-
1. GENERAL INFORMATION
Dear customer,
Thank you very much for choosing our product. In the following, we will
show you what you need to consider during commissioning and use.
Should you unexpectedly encounter problems during use, please do not
hesitate to contact us.
www.joy it.net-
Pascalstr. 8 47506 Neukirchen Vluyn-
3. COMMISSIONING WITH THE RASPBERRY PI
Wiring:
Installation:
To be able to use the ADC, you have to enable I2C.
Enter the following command:
Now navigate to the point > and enable the I2C interface.Interfacing Options -I2C
sudo raspi config-
Raspberry Pi MMA8452Q
GND (Pin 6) GND
3v3 (Pin 1) VCC
SDA (Pin 3) SDA
SCL (Pin 5) SCL
www.joy it.net-
Pascalstr. 8 47506 Neukirchen Vluyn-
Code example:
# Distributed with a free will license.-
# Use it any way you want, profit or free, provided it fits in the licenses of its
# associated works.
import smbus
import time
# Get I2C bus
bus = smbus.SMBus(1)
# MMA8452Q address, 0x1D(28)
# Select Control register, 0x2A(42)
# 0x00(00) StandBy mode
bus.write_byte_data( , , 0x1D 0x2A 0x00)
# MMA8452Q address, 0x1D(28)
# Select Control register, 0x2A(42)
# 0x01(01) Active mode
bus.write_byte_data( , , 0x1D 0x2A 0x01)
# MMA8452Q address, 0x1D(28)
# Select Configuration register, 0x0E(14)
# 0x00(00) Set range to +/- 2g
bus.write_byte_data( , , 0x1D 0x0E 0x00)
time.sleep(0.5)
# MMA8452Q address, 0x1D(28)
# Read data back from 0x00(0), 7 bytes
# Status register, X Axis MSB, X- - - - - -Axis LSB, Y Axis MSB, Y Axis LSB, Z Axis MSB, Z Axis LSB
data = bus.read_i2c_block_data(0x1D, , 0x00 7)
# Convert the data
xAccl = (data[ ] * 1 256 16 + data[2]) /
if xAccl > :2047
- xAccl = 4096
yAccl = (data[ ] * 3 256 16 + data[4]) /
if yAccl > :2047
- yAccl = 4096
zAccl = (data[ ] * 5 256 16 + data[6]) /
if zAccl > :2047
- zAccl = 4096
# 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
Now create a file with the extension ".py" and copy the code example into it.
Then execute this file with the console command shown below:
You should now see the values of the three axes as a console output.
sudo python file- name.py

Produktspezifikationen

Marke: Joy-it
Kategorie: niet gecategoriseerd
Modell: SEN-MMA8452Q

Brauchst du Hilfe?

Wenn Sie Hilfe mit Joy-it SEN-MMA8452Q benötigen, stellen Sie unten eine Frage und andere Benutzer werden Ihnen antworten




Bedienungsanleitung niet gecategoriseerd Joy-it

Bedienungsanleitung niet gecategoriseerd

Neueste Bedienungsanleitung für -Kategorien-