{"id":27975,"date":"2019-12-17T10:21:13","date_gmt":"2019-12-17T02:21:13","guid":{"rendered":"\/blog\/?p=27975"},"modified":"2019-12-18T22:07:17","modified_gmt":"2019-12-18T14:07:17","slug":"lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started","status":"publish","type":"post","link":"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/","title":{"rendered":"LSM303 Accelerometer: Arduino, Raspberry Pi Guide to get started"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"762\" height=\"380\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2019\/12\/lsm303-cover-1.png\" alt=\"\" class=\"wp-image-28015\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover-1.png 762w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover-1-300x150.png 300w\" sizes=\"(max-width: 762px) 100vw, 762px\" \/><\/figure>\n\n\n\n<p>Looking for a 3-axis accelerometer that&#8217;s easily pairable with your Arduino and has a magnetometer (compass) onboard? The LSM303 based Grove 6-Axis Accelerometer&amp;Compass v2 does just that!<\/p>\n\n\n\n<p>In today&#8217;s&#8217; blog, I&#8217;ll be introducing the LSM303 Accelerometer and showing you how to connect the LSM303 to an Arduino and Raspberry Pi. All to help you get started!<\/p>\n\n\n\n<p>Note: This blog includes the LSM303 datasheet for your reference as well!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>LSM303 Based Module: <a href=\"https:\/\/www.seeedstudio.com\/Grove-6-Axis-Accelerometer-Compass-v2-0.html?utm_source=blog&amp;utm_medium=blog\">Grove &#8211; 6 Axis Accelerometer&amp;Compass v2.0<\/a><\/strong><\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"https:\/\/media-cdn.seeedstudio.com\/media\/catalog\/product\/cache\/ab187aaa5f626ad16c8031644cd2de5b\/h\/t\/httpsstatics3.seeedstudio.comproduct101020081201_01.jpg\" alt=\"\" width=\"350\" height=\"263\"\/><\/figure><\/div>\n\n\n\n<p>Based on the LSM303D, this accelerometer is packed with 3 magnetic field channels and 3 acceleration channels. This enables electromagnetic field and gravitational force readings all in a small package! <\/p>\n\n\n\n<p>Not only that, the Grove &#8211; 6-Axis Accelerometer&amp;Compass doesn&#8217;t lose out to other popular mems accelerometers you&#8217;ve heard and known today as well! <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>It matches the \u00b116g accelerometer output that adxl345 offers<\/li><li>Its 16-bit data output makes it easily parable with a microcontroller<\/li><li>Onboard 3D magnetometer that&#8217;s lacking on the adxl345 allows for a wider range of applications<\/li><\/ul>\n\n\n\n<p><strong>Here are its features:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Input Voltage: 5V<\/li><li>SPI\/I2C Interfaces (Selectable)<\/li><li>2 Independent programmable Interrupt<\/li><li>Wide Full-Scale Range<ul><li>\u00b12\/\u00b14\/\u00b18\/\u00b112 gauss magnetic full scale<\/li><li>\u00b12\/\u00b14\/\u00b16\/\u00b18\/\u00b116g acceleration full scale <\/li><\/ul><\/li><li>6D orientation detection<\/li><li>Power-down Mode \/ Low-power Mode<\/li><\/ul>\n\n\n\n<p><strong>Key applications include:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Pedometers<\/li><li>Free-fall detection<\/li><li>Display orientation<\/li><li>Gaming and virtual reality input devices<\/li><li>Vibration monitoring and compensation<\/li><li>Position detection<\/li><\/ul>\n\n\n\n<p><strong>Hardware overview with Pinout: <\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/SeeedDocument\/Grove-6-Axis_AccelerometerAndCompass_V2.0\/master\/img\/Grove-6-Axis_AccelerometerAndCompass_V2.0_inter.jpg\" alt=\"\" width=\"380\" height=\"226\"\/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>Pin 1: Grove interface, connect to I2C<\/li><li>Pin 2: SPI Interface<\/li><li>Pin 3: I2C or SPI select pad (default is I2C). <ul><li>Disconnect this pad if you want to use SPI<\/li><\/ul><\/li><li>Pin 4: Interrupt digital output<\/li><li>Pin 5: Address select pad<ul><li>By default, connected b and a address is 0x1E, if connect b and c address is 0x1D<\/li><li>If you want to use SPI, disconnect this pad to either side<\/li><\/ul><\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Why you should pick this LSM303 module instead of other breakout boards in the market? <\/strong><\/h4>\n\n\n\n<p>You can find other LSM303 breakout boards, sensors, modules, etc. available, but what makes the Grove \u2013 6-Axis Accelerometer&amp;Compass V2.0 the one to go with? Here\u2019s why!<\/p>\n\n\n\n<p style=\"background-color:#eaf1ea\" class=\"has-background\"><strong>Ease of pairing LSM303 with Arduino through Seeed\u2019s very own&nbsp;<a href=\"https:\/\/www.seeedstudio.com\/document\/pdf\/Introduction%20to%20Grove.pdf\">Grove system<\/a><\/strong><\/p>\n\n\n\n<p>Grove system is Seeed very own initiative, mainly aimed at helping users like yourself to easily use different modules, through our plug and play system!<\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>This means no more using messy and complicated jumper wires, soldering, breadboard, or debugging electronic circuits!&nbsp;<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-gallery columns-2 wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"501\" height=\"303\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2019\/12\/LSM303-breakout-board.png\" alt=\"\" data-id=\"27997\" class=\"wp-image-27997\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/LSM303-breakout-board.png 501w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/LSM303-breakout-board-300x181.png 300w\" sizes=\"(max-width: 501px) 100vw, 501px\" \/><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"519\" height=\"407\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2019\/12\/lsm303-grove.png\" alt=\"\" data-id=\"27998\" data-link=\"\/blog\/?attachment_id=27998\" class=\"wp-image-27998\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-grove.png 519w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-grove-300x235.png 300w\" sizes=\"(max-width: 519px) 100vw, 519px\" \/><\/figure><\/li><\/ul>\n\n\n\n<p style=\"font-size:17px\">Like how simple and less messy it is compared to other VL53L0X modules?<\/p>\n\n\n\n<p style=\"font-size:17px\"><strong>All you need is a&nbsp;<a href=\"https:\/\/www.seeedstudio.com\/Base-Shield-V2.html?utm_source=blog&amp;utm_medium=blog\">Grove Base Shield<\/a>&nbsp;alongside your Arduino and you\u2019re good to go! Switch to using grove today!<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>LSM303 Arduino and Raspberry Pi Guide<\/strong><\/h2>\n\n\n\n<p>We&#8217;ve provided both Arduino and Raspberry Pi library to help you get started. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>LSM303 Arduino Guide<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>To get started, you&#8217;ll first&nbsp;need&nbsp;the&nbsp;following:<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-gallery columns-3 is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"210\" height=\"157\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2019\/12\/seeeduino-v4.2-3.jpg\" alt=\"\" data-id=\"27999\" data-link=\"\/blog\/?attachment_id=27999\" class=\"wp-image-27999\"\/><figcaption><a href=\"http:\/\/www.seeedstudio.com\/Seeeduino-V4.2-p-2517.html?utm_source=blog&amp;utm_medium=blog\">Seeeduino V4.2<\/a><\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"210\" height=\"157\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2019\/12\/base-shield-5.jpg\" alt=\"\" data-id=\"28000\" data-link=\"\/blog\/?attachment_id=28000\" class=\"wp-image-28000\"\/><figcaption><a href=\"https:\/\/www.seeedstudio.com\/Base-Shield-V2-p-1378.html?utm_source=blog&amp;utm_medium=blog\">Grove &#8211; Base Shield<\/a><\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"525\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2019\/12\/grove-6-axis-LSM303.jpg\" alt=\"\" data-id=\"28001\" data-link=\"\/blog\/?attachment_id=28001\" class=\"wp-image-28001\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/grove-6-axis-LSM303.jpg 700w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/grove-6-axis-LSM303-300x225.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption><a href=\"https:\/\/www.seeedstudio.com\/Grove-6-Axis-Accelerometer%26Compass-v2.0-p-2476.html?utm_source=blog&amp;utm_medium=blog\">Grove &#8211; 6 Axis Accelerometer and Compass V2.0<\/a><\/figcaption><\/figure><\/li><\/ul>\n\n\n\n<p><em>*Seeeduino is Seeed\u2019s very own Arduino, built with benefits over the regular Arduino boards.&nbsp;<\/em> <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Hardware configurations:<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Step 1: <\/strong>Connect the Grove &#8211; 6-Axis Accelerometer&amp;Compass V2.0 to port I2C of Grove-Base Shield<\/li><li><strong>Step 2:<\/strong> Plug Grove &#8211; Base Shield to Seeeduino<\/li><li><strong>Step 3:<\/strong> Connect Seeeduino to PC via a USB cable<\/li><\/ul>\n\n\n\n<p>It should look like this after pairing things up:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/SeeedDocument\/Grove-6-Axis_AccelerometerAndCompass_V2.0\/raw\/master\/img\/with_ardu.jpg\" alt=\"\" width=\"366\" height=\"275\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Software configurations:<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Step 1:<\/strong> Download the library from Github<\/li><li><strong>Step 2<\/strong>: Refer to How to install library to install library for Arduino<\/li><li><strong>Step 3:<\/strong> Create a new Arduino sketch and paste the codes below to it or open the code directly by the path: File -&gt; Example -&gt;Accelerometer_Compass-&gt;Accelerometer_Compass<\/li><li><strong>Step 4:<\/strong> Upload the following code. If you do not know how to upload the code, please check&nbsp;<a href=\"http:\/\/wiki.seeedstudio.com\/Upload_Code\/\">how to upload code<\/a><\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>\/* LSM303DLM Example Code base on LSM303DLH example code by Jim Lindblom SparkFun Electronics\n\n   date: 9\/6\/11\n   license: Creative commons share-alike v3.0\n\n   Modified by:Frankie.Chu\n   Modified by:Jacky.Zhang 2014-12-11: Ported to 6-Axis Accelerometer&amp;Compass of Seeed Studio\n   Modified by:Jacky.Zhang 2015-1-6: added SPI driver\n\n   Summary:\n   Show how to calculate level and tilt-compensated heading using\n   the snazzy LSM303DLH 3-axis magnetometer\/3-axis accelerometer.\n\n   Firmware:\n   You can set the accelerometer's full-scale range by setting\n   the SCALE constant to either 2, 4, or 8. This value is used\n   in the initLSM303() function. For the most part, all other\n   registers in the LSM303 will be at their default value.\n\n   Use the write() and read() functions to write\n   to and read from the LSM303's internal registers.\n\n   Use getLSM303_accel() and getLSM303_mag() to get the acceleration\n   and magneto values from the LSM303. You'll need to pass each of\n   those functions an array, where the data will be stored upon\n   return from the void.\n\n   getHeading() calculates a heading assuming the sensor is level.\n   A float between 0 and 360 is returned. You need to pass it a\n   array with magneto values.\n\n   getTiltHeading() calculates a tilt-compensated heading.\n   A float between 0 and 360 degrees is returned. You need\n   to pass this function both a magneto and acceleration array.\n\n   Headings are calculated as specified in AN3192:\n   http:\/\/www.sparkfun.com\/datasheets\/Sensors\/Magneto\/Tilt%20Compensated%20Compass.pdf\n*\/\n\n\/*\nhardware &amp; software comment\nI2C mode:\n1, solder the jumper \"I2C EN\" and the jumper of ADDR to 0x1E\n2, use Lsm303d.initI2C() function to initialize the Grove by I2C\nSPI mode:\n1, break the jumper \"I2C_EN\" and the jumper ADDR to any side\n2, define a pin as chip select for SPI protocol.\n3, use Lsm303d.initSPI(SPI_CS) function to initialize the Grove by SPI\nSPI.h sets these for us in arduino\nconst int SDI = 11;\nconst int SDO = 12;\nconst int SCL = 13;\n*\/\n\n#include &lt;LSM303D.h>\n#include &lt;Wire.h>\n#include &lt;SPI.h>\n\n\/* Global variables *\/\nint accel[3];  \/\/ we'll store the raw acceleration values here\nint mag[3];  \/\/ raw magnetometer values stored here\nfloat realAccel[3];  \/\/ calculated acceleration values here\nfloat heading, titleHeading;\n\n#define SPI_CS 10\n\nvoid setup()\n{\n    char rtn = 0;\n    Serial.begin(9600);  \/\/ Serial is used for debugging\n    Serial.println(\"\\r\\npower on\");\n    rtn = Lsm303d.initI2C();\n    \/\/rtn = Lsm303d.initSPI(SPI_CS);\n    if(rtn != 0)  \/\/ Initialize the LSM303, using a SCALE full-scale range\n    {\n        Serial.println(\"\\r\\nLSM303D is not found\");\n        while(1);\n    }\n    else\n    {\n        Serial.println(\"\\r\\nLSM303D is found\");\n    }\n}\n\nvoid loop()\n{\n    Serial.println(\"\\r\\n**************\");\n    \/\/getLSM303_accel(accel);  \/\/ get the acceleration values and store them in the accel array\n    Lsm303d.getAccel(accel);\n    while(!Lsm303d.isMagReady());\/\/ wait for the magnetometer readings to be ready\n    Lsm303d.getMag(mag);  \/\/ get the magnetometer values, store them in mag\n\n    for (int i=0; i&lt;3; i++)\n    {\n        realAccel[i] = accel[i] \/ pow(2, 15) * ACCELE_SCALE;  \/\/ calculate real acceleration values, in units of g\n    }\n    heading = Lsm303d.getHeading(mag);\n    titleHeading = Lsm303d.getTiltHeading(mag, realAccel);\n\n    printValues();\n\n    delay(200);  \/\/ delay for serial readability\n}\n\nvoid printValues()\n{  \n    Serial.println(\"Acceleration of X,Y,Z is\");\n    for (int i=0; i&lt;3; i++)\n    {\n        Serial.print(realAccel[i]);\n        Serial.println(\"g\");\n    }\n    \/\/print both the level, and tilt-compensated headings below to compare\n    Serial.println(\"The clockwise angle between the magnetic north and x-axis: \");\n    Serial.print(heading, 3); \/\/ this only works if the sensor is level\n    Serial.println(\" degrees\");\n    Serial.print(\"The clockwise angle between the magnetic north and the projection\");\n    Serial.println(\" of the positive x-axis in the horizontal plane: \");\n    Serial.print(titleHeading, 3);  \/\/ see how awesome tilt compensation is?!\n    Serial.println(\" degrees\");\n}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Step 5:<\/strong> Open the serial monitor, you&#8217;ll see the output result of Color Sensor as shown below:<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/SeeedDocument\/Grove-6-Axis_AccelerometerAndCompass_V2.0\/master\/img\/6-Axis_AccelerometerAndCompass_V2.0_demo.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Step 6: <\/strong>You can see the acceleration values and clockwise angle between the magnetic north and x-axis<\/li><\/ul>\n\n\n\n<p>The X\/Y\/Z shows the 3 axis acceleration, and then the angle between the magnetic north and x-axis calculated.<\/p>\n\n\n\n<p>And also the angle between the magnetic north and the projection of positive x-axis calculated.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"mce_59\"><strong>LSM303 Raspberry Pi Guide<\/strong><\/h3>\n\n\n\n<p>The following tutorial uses the Raspberry Pi 3 Model B, though other models such as Pi B\/B+\/A+\/2\/3 fits as well.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">What you&#8217;ll need to get started:<\/h4>\n\n\n\n<ul class=\"wp-block-gallery columns-3 is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"525\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2019\/12\/raspberry-pi-3-model-b.jpg\" alt=\"\" data-id=\"28003\" class=\"wp-image-28003\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/raspberry-pi-3-model-b.jpg 700w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/raspberry-pi-3-model-b-300x225.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption>Raspberry PI 3 Model B<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"210\" height=\"157\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2019\/12\/Grovepi.jpg\" alt=\"\" data-id=\"28004\" data-link=\"\/blog\/?attachment_id=28004\" class=\"wp-image-28004\"\/><figcaption><a href=\"https:\/\/www.seeedstudio.com\/GrovePi%2B-p-2241.html?utm_source=blog&amp;utm_medium=blog\">GrovePi_Plus<\/a><\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"525\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2019\/12\/grove-6-axis-LSM303-1.jpg\" alt=\"\" data-id=\"28005\" data-link=\"\/blog\/?attachment_id=28005\" class=\"wp-image-28005\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/grove-6-axis-LSM303-1.jpg 700w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/grove-6-axis-LSM303-1-300x225.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption> <br><a href=\"https:\/\/www.seeedstudio.com\/Grove-6-Axis-Accelerometer%26Compass-v2.0-p-2476.html?utm_source=blog&amp;utm_medium=blog\">Grove &#8211; 6 Axis Accelerometer and Compass V2.0 <\/a><\/figcaption><\/figure><\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Hardware configurations:<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>Step 1: Plug the GrovePi_Plus into Raspberry<\/li><li>Step 2: Connect Grove -6-Axis Accelerometer and Compass V2.0 to I2C port of GrovePi_Plus<\/li><li>Step 3: Connect the Raspberry to PC through USB cable<\/li><\/ul>\n\n\n\n<p>It should look something like this after pairing things up: <\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/SeeedDocument\/Grove-6-Axis_AccelerometerAndCompass_V2.0\/master\/img\/with_rpi.jpg\" alt=\"\" width=\"317\" height=\"238\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Software configurations<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Step 1:<\/strong> Follow Setting Software to configure the development environment<\/li><li><strong>Step 2:<\/strong> Git clone the Github repository <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>cd ~\ngit clone https:\/\/github.com\/DexterInd\/GrovePi.git<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Step 3:<\/strong> Execute below commands to use this sensor<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>cd ~\/GrovePi\/Software\/Python\/grove_6axis_acc_compass\npython grove_6axis_accel_compass_example.py<\/code><\/pre>\n\n\n\n<p>Here is the python code of example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/usr\/bin\/env python\n#\n# GrovePi example for using the Grove - 6-Axis Accelerometer&amp;Compass v2.0(http:\/\/www.seeedstudio.com\/depot\/Grove-6Axis-AccelerometerCompass-v20-p-2476.html)\n#\n# The GrovePi connects the Raspberry Pi and Grove sensors.  You can learn more about GrovePi here:  http:\/\/www.dexterindustries.com\/GrovePi\n#\n# Have a question about this library?  Ask on the forums here:  http:\/\/forum.dexterindustries.com\/c\/grovepi\n#\n'''\n## License\nThe MIT License (MIT)\nGrovePi for the Raspberry Pi: an open source platform for connecting Grove Sensors to the Raspberry Pi.\nCopyright (C) 2017  Dexter Industries\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n'''\nimport lsm303d\n\ntry:\n    acc_mag=lsm303d.lsm303d()\n\n    while True:\n\n        # Get accelerometer values\n        acc=acc_mag.getRealAccel()\n\n        # Wait for compass to get ready\n        while True:\n            if acc_mag.isMagReady():\n                break\n\n        # Read the heading\n        heading= acc_mag.getHeading()\n\n        print(\"Acceleration of X,Y,Z is %.3fg, %.3fg, %.3fg\" %(acc[0],acc[1],acc[2]))\n        print(\"Heading %.3f degrees\\n\" %(heading))\n\nexcept IOError:\n    print(\"Unable to read from accelerometer, check the sensor and try again\")<\/code><\/pre>\n\n\n\n<p>Here is the result:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/github.com\/SeeedDocument\/Grove-6-Axis_AccelerometerAndCompass_V2.0\/raw\/master\/img\/rpi_result.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Resources and Going Further<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>[Library]<\/strong>\u00a0<a href=\"https:\/\/github.com\/Seeed-Studio\/6Axis_Accelerometer_And_Compass_v2\">6-Axis Accelerometer&amp;Compass v2.0 Library for Arduino<\/a><\/li><li><strong>[Library]<\/strong>\u00a0<a href=\"https:\/\/github.com\/DexterInd\/GrovePi\/blob\/master\/Software\/Python\/grove_6axis_acc_compass\">6-Axis Accelerometer&amp;Compass v2.0 Library for raspberry pi<\/a><\/li><li><strong>[Datasheet]<\/strong>\u00a0<a href=\"https:\/\/raw.githubusercontent.com\/SeeedDocument\/Grove-6-Axis_AccelerometerAndCompass_V2.0\/master\/res\/LSM303D_datasheet.pdf\">LSM303D datasheet<\/a><\/li><li><strong>[Eagle]<\/strong>\u00a0<a href=\"https:\/\/raw.githubusercontent.com\/SeeedDocument\/Grove-6-Axis_AccelerometerAndCompass_V2.0\/master\/res\/Grove-6-Axis_AccelerometerAndCompass_v2.0_sch_pcb.zip\">6-Axis Accelerometer&amp;Compass v2.0 eagle file<\/a><\/li><li><strong>[Projects]<\/strong> <a href=\"https:\/\/project.seeedstudio.com\/baqwas\/heads-up-for-your-heading-5bf472\">6-Axis Accelerometer&amp;Compass v2.0 Project<\/a><\/li><li><a href=\"https:\/\/www.seeedstudio.com\/blog\/2019\/11\/26\/adxl356-get-started-adxl345-and-adxl335-comparison-guide\/\">More on ADXL345 and memes accelerometer<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Summary <\/strong><\/h2>\n\n\n\n<p>Overall, with the LSM303 integrating a 3D compass sensor alongside&nbsp;the standard 3-axis accelerometer, it truly opens up a wider range of possibilities that&#8217;s applicable in day-to-day applications. With it, you can now easily orient your motion-sensing projects!<\/p>\n\n\n\n<p>Consider the <a href=\"https:\/\/www.seeedstudio.com\/Grove-6-Axis-Accelerometer-Compass-v2-0.html\">Grove &#8211; 6 Axis Accelerometer&amp;Compass v2.0 (LSM303D),<\/a>&nbsp;a module based on the LSM303 that&#8217;s easier to integrate with your Arduino and Raspberry Pi! <\/p>\n\n\n\n<p><em>If you&#8217;re looking to find out more about mems accelerometer, particularly the ADXL series, you can check out <\/em><a href=\"http:\/\/www.seeedstudio.com\/blog\/2019\/11\/26\/adxl356-get-started-adxl345-and-adxl335-comparison-guide\/\"><em>this article!<\/em><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Looking for a 3-axis accelerometer that&#8217;s easily pairable with your Arduino and has a magnetometer<\/p>\n","protected":false},"author":2850,"featured_media":28012,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_tribe_ticket_capacity":"0","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"iawp_total_views":0,"footnotes":""},"categories":[1],"tags":[2362,2279,2162],"class_list":["post-27975","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","tag-lsm303-accelerometer","tag-magnetometer","tag-mems-accelerometer"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>LSM303 Accelerometer: Arduino, Raspberry Pi Guide to get started - Latest News from Seeed Studio<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"LSM303 Accelerometer: Arduino, Raspberry Pi Guide to get started - Latest News from Seeed Studio\" \/>\n<meta property=\"og:description\" content=\"Looking for a 3-axis accelerometer that&#8217;s easily pairable with your Arduino and has a magnetometer\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/\" \/>\n<meta property=\"og:site_name\" content=\"Latest News from Seeed Studio\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-17T02:21:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-12-18T14:07:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png\" \/>\n\t<meta property=\"og:image:width\" content=\"762\" \/>\n\t<meta property=\"og:image:height\" content=\"380\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Shawn\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Shawn\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/\",\"name\":\"LSM303 Accelerometer: Arduino, Raspberry Pi Guide to get started - Latest News from Seeed Studio\",\"isPartOf\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png\",\"datePublished\":\"2019-12-17T02:21:13+00:00\",\"dateModified\":\"2019-12-18T14:07:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/c9b61b761840d544e2d830b0e3bc9fe2\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/#primaryimage\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png\",\"contentUrl\":\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png\",\"width\":762,\"height\":380,\"caption\":\"lsm303 accelerometer: features, arduino and raspberry pi guide\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.seeedstudio.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LSM303 Accelerometer: Arduino, Raspberry Pi Guide to get started\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#website\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/\",\"name\":\"Latest News from Seeed Studio\",\"description\":\"Emerging IoT, AI and Autonomous Applications on the Edge\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.seeedstudio.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/c9b61b761840d544e2d830b0e3bc9fe2\",\"name\":\"Shawn\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5afdc71205d9d485de69bc4b192294e3?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5afdc71205d9d485de69bc4b192294e3?s=96&r=g\",\"caption\":\"Shawn\"},\"url\":\"https:\/\/www.seeedstudio.com\/blog\/author\/shawn\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"LSM303 Accelerometer: Arduino, Raspberry Pi Guide to get started - Latest News from Seeed Studio","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/","og_locale":"en_US","og_type":"article","og_title":"LSM303 Accelerometer: Arduino, Raspberry Pi Guide to get started - Latest News from Seeed Studio","og_description":"Looking for a 3-axis accelerometer that&#8217;s easily pairable with your Arduino and has a magnetometer","og_url":"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/","og_site_name":"Latest News from Seeed Studio","article_published_time":"2019-12-17T02:21:13+00:00","article_modified_time":"2019-12-18T14:07:17+00:00","og_image":[{"width":762,"height":380,"url":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png","type":"image\/png"}],"author":"Shawn","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Shawn","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/","url":"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/","name":"LSM303 Accelerometer: Arduino, Raspberry Pi Guide to get started - Latest News from Seeed Studio","isPartOf":{"@id":"https:\/\/www.seeedstudio.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/#primaryimage"},"image":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/#primaryimage"},"thumbnailUrl":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png","datePublished":"2019-12-17T02:21:13+00:00","dateModified":"2019-12-18T14:07:17+00:00","author":{"@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/c9b61b761840d544e2d830b0e3bc9fe2"},"breadcrumb":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/#primaryimage","url":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png","contentUrl":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png","width":762,"height":380,"caption":"lsm303 accelerometer: features, arduino and raspberry pi guide"},{"@type":"BreadcrumbList","@id":"https:\/\/www.seeedstudio.com\/blog\/2019\/12\/17\/lsm303-accelerometer-arduino-raspberry-pi-guide-to-get-started\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.seeedstudio.com\/blog\/"},{"@type":"ListItem","position":2,"name":"LSM303 Accelerometer: Arduino, Raspberry Pi Guide to get started"}]},{"@type":"WebSite","@id":"https:\/\/www.seeedstudio.com\/blog\/#website","url":"https:\/\/www.seeedstudio.com\/blog\/","name":"Latest News from Seeed Studio","description":"Emerging IoT, AI and Autonomous Applications on the Edge","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.seeedstudio.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/c9b61b761840d544e2d830b0e3bc9fe2","name":"Shawn","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5afdc71205d9d485de69bc4b192294e3?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5afdc71205d9d485de69bc4b192294e3?s=96&r=g","caption":"Shawn"},"url":"https:\/\/www.seeedstudio.com\/blog\/author\/shawn\/"}]}},"modified_by":"Shawn","views":24452,"featured_image_urls":{"full":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png",762,380,false],"thumbnail":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover-80x80.png",80,80,true],"medium":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover-300x150.png",300,150,true],"medium_large":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png",640,319,false],"large":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png",640,319,false],"1536x1536":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png",762,380,false],"2048x2048":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png",762,380,false],"visody_icon":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png",32,16,false],"magazine-7-slider-full":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png",762,380,false],"magazine-7-slider-center":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png",762,380,false],"magazine-7-featured":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png",762,380,false],"magazine-7-medium":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png",720,359,false],"magazine-7-medium-square":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/12\/lsm303-cover.png",675,337,false]},"author_info":{"display_name":"Shawn","author_link":"https:\/\/www.seeedstudio.com\/blog\/author\/shawn\/"},"category_info":"<a href=\"https:\/\/www.seeedstudio.com\/blog\/category\/news\/\" rel=\"category tag\">News<\/a>","tag_info":"News","comment_count":"0","_links":{"self":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/27975","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/users\/2850"}],"replies":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/comments?post=27975"}],"version-history":[{"count":5,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/27975\/revisions"}],"predecessor-version":[{"id":28076,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/27975\/revisions\/28076"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/media\/28012"}],"wp:attachment":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/media?parent=27975"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/categories?post=27975"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/tags?post=27975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}