element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Hats Off Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Hats Off Design Challenge
  • More
  • Cancel
Hats Off Design Challenge
Blog Hats Off Fascinator 8: Connections Part Un
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: brenyc13
  • Date Created: 10 Sep 2014 11:48 AM Date Created
  • Views 556 views
  • Likes 0 likes
  • Comments 0 comments
  • jaunty_fascinator
  • hats_off
  • accelerometer
  • Wearables
  • adafruit_gemma
  • adafruit
Related
Recommended

Hats Off Fascinator 8: Connections Part Un

brenyc13
brenyc13
10 Sep 2014

A brief post wherein I talk about connecting the Gemma to the accelerometer.

 

image

 

Neck bone connected to the…

Okay. So as you can see from my little sketch above, the Gemma’s GND, D1, and Vout will be connected to the NeoPixel while GND, D2, D0, and 3Vo will be connected to the accelerometer.


Accepting the accelerometer

The Flora Accelerometer contains two sensors inside: a fancy magnetometer that senses the direction of the strongest magnetic force (usually magnetic north) and also a 3-axis accelerometer that reads how fast it is accelerating in 3D space. For my purposes, I’m only concerned about the latter.



image


50 Shades of Gemma

The accelerometer has a digital I²C interface. This means that it uses two lines, known as Serial Data (SDL) and Serial Clock (SCL). The clock line is used to synchronize the data between the “master” and “slave.” I think it's because "talking" over this data line is like talking to someone over Google Hangouts: only one person can speak at at time or else the echo-blocker or whatever will mute you and the call descends into chaos. Same here. Only one device can send data at a time. The master device drives the clock line, telling the slave when it should pipe up and the slave device responds. In this case, the Gemma is the master and the accelerometer is the slave. Whipchya!


Reading into things...

My Assistant and I read through the spec sheet for the accelerometer chip in order to find the right addresses for the program to look for the data from the accelerometer and in the code it ended up looking like this:


#define ACCEL_ADDR (0x32 >> 1)

#define OUT_X_L_A 0x28

#define OUT_X_H_A 0x29

#define OUT_Y_L_A 0x2a

#define OUT_Y_H_A 0x2b

#define OUT_Z_L_A 0x2c

#define OUT_Z_H_A 0x2d

#define CTRL_REG1_A 0x20

 

But I'll write more about all that on Saturday when I talk about my attempts at serial debugging. Till then, Whipchya!

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube