Tommaso Martorellasilvia11931
Published © GPL3+

Reading Acceleration Sensor with Zerynth

In this tutorial we'll see how to read data from an acceleration sensor using Zerynth.

BeginnerFull instructions provided1 hour802
Reading Acceleration Sensor with Zerynth

Things used in this project

Hardware components

MIKROE Flip&Click
×1
MIKROE 10DOF Click
×1

Software apps and online services

Zerynth Studio
Zerynth Studio

Story

Read more

Schematics

project_scheme.png

This is the project scheme

Code

main.py

Python
################################################################################
# Get Acceleration Example
#
# Created: 2017-02-24 12:48:43.342375
#
################################################################################

from bosch.bno055 import bno055
import streams

streams.serial()

# Setup sensor 
# This setup is referred to bno055 mounted on 10DOF Click in slot A of a Flip n Click device 

print("Start...")
bno = bno055.BNO055(I2C0)
bno.start()
print("Init...")
# Enabled Accelerometer
bno.init("acc") # Operating Mode ACCONLY (only raw accelerometer data)
print("Ready!")
print("--------------------------------------------------------")

while True:
    data = bno.get_acc() # Read Data on 3 axis
    print("Acceleration on XYZ", data)
    print("--------------------------------------------------------")
    sleep(5000)

Credits

Tommaso Martorella

Tommaso Martorella

8 projects • 4 followers
silvia11931

silvia11931

10 projects • 9 followers

Comments