{"id":4270,"date":"2025-01-22T09:01:12","date_gmt":"2025-01-22T17:01:12","guid":{"rendered":"https:\/\/www.donluc.com\/?p=4270"},"modified":"2025-01-22T09:01:12","modified_gmt":"2025-01-22T17:01:12","slug":"project-25-movement-hmc5883l-mk08","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=4270","title":{"rendered":"Project #25 &#8211; Movement &#8211; HMC5883L &#8211; Mk08"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-4270-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk05W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk05W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk05W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #HMC5883L #ADXL345 #Accelerometer #Movement #ESP32 #Bluetooth #Elecrow #DFRobot #Arduino #Project #Patreon #Electronics #Microcontrollers #IoT #Fritzing #Programming #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk05a.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk05a.jpg\" alt=\"HMC5883L\" width=\"720\" height=\"644\" class=\"alignnone size-full wp-image-4272\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk05a.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk05a-300x268.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk05b.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk05b.jpg\" alt=\"HMC5883L\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-4273\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk05b.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk05b-300x200.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk05c.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk05c.jpg\" alt=\"HMC5883L\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-4274\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk05c.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk05c-300x200.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Crowtail &#8211; 3-Axis Digital Compass<\/strong><\/p>\n<p>Crowtail-3-Axis Compass module, a member of Crowtail family uses I\u00b2C based Honeywell HMC5883L digital compass. This ASIC is equipped with high resolution HMC118X magneto-resistive sensors and a 12-bit ADC. It provides compass heading accuracy up to 1\u00b0 to 2\u00b0. Signal conditioning like amplification, automatic degaussing strap drivers and offset cancellation are inbuilt. This Crowtail module also includes a XC6206P332MR for power supply requirement. Hence user can connect any 3.3V to 6V DC power supply.<\/p>\n<ul>\n<li>-Crowtail compatible interface<\/li>\n<li>-3-Axis Magneto-resistive type sensors<\/li>\n<li>-I\u00b2C serial interface<\/li>\n<li>-1\u00b0 to 2\u00b0 Degree heading accuracy<\/li>\n<li>-Up to 116 Hz Maximum output rate<\/li>\n<li>-Built-In self test<\/li>\n<li>-Low cost compassing<\/li>\n<li>-Magnetometry<\/li>\n<li>-Pedestrian navigation<\/li>\n<li>-Hobby auto navigation<\/li>\n<li>-Compassing support for mobile devices and portable computers<\/li>\n<\/ul>\n<p><strong>DL2501Mk05<\/strong><\/p>\n<p>1 x DFRobot FireBeetle 2 ESP32-E<br \/>\n1 x Fermion: 2.0&#8243; 320&#215;240 IPS TFT LCD<br \/>\n1 x GDL Line 10 CM<br \/>\n1 x Crowtail &#8211; I2C Hub 2.0<br \/>\n1 x Crowtail &#8211; 3-Axis Digital Compass<br \/>\n1 x Crowtail &#8211; 3-Axis Digital Accelerometer<br \/>\n1 x Lithium Ion Battery &#8211; 1000mAh<br \/>\n1 x Switch<br \/>\n1 x Bluetooth Serial Terminal<br \/>\n1 x USB 3.1 Cable A to C<\/p>\n<p><strong>FireBeetle 2 ESP32-E<\/strong><\/p>\n<p>SCL &#8211; 22<br \/>\nSDA &#8211; 21<br \/>\nDC &#8211; D2<br \/>\nCS &#8211; D6<br \/>\nRST &#8211; D3<br \/>\nRX2 &#8211; Bluetooth<br \/>\nTX2 &#8211; Bluetooth<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p><strong>DL2501Mk05p<\/strong><\/p>\n<p><strong>DL2501Mk05p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/****** Don Luc Electronics \u00a9 ******\r\nSoftware Version Information\r\nProject #25 - Movement - HMC5883L - Mk08\r\n25-08\r\nDL2501Mk05p.ino\r\nDL2501Mk05\r\n1 x DFRobot FireBeetle 2 ESP32-E\r\n1 x Fermion: 2.0&quot; 320x240 IPS TFT LCD\r\n1 x GDL Line 10 CM\r\n1 x Crowtail - I2C Hub 2.0\r\n1 x Crowtail - 3-Axis Digital Compass\r\n1 x Crowtail - 3-Axis Digital Accelerometer\r\n1 x Lithium Ion Battery - 1000mAh\r\n1 x Switch\r\n1 x Bluetooth Serial Terminal\r\n1 x USB 3.1 Cable A to C\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ Arduino\r\n#include &lt;Arduino.h&gt;\r\n\/\/ Wire\r\n#include &lt;Wire.h&gt;\r\n\/\/ DFRobot Display GDL API\r\n#include &lt;DFRobot_GDL.h&gt;\r\n\/\/ Bluetooth Serial\r\n#include &quot;BluetoothSerial.h&quot;\r\n#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)\r\n#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it\r\n#endif\r\n\/\/ Accelemeter ADXL345\r\n#include &lt;ADXL345.h&gt;\r\n\/\/ Compass HMC5883L\r\n#include &lt;HMC5883L.h&gt;\r\n\r\n\/\/ Compass HMC5883L\r\nHMC5883L compass;\r\n\/\/ Heading\r\nfloat heading;\r\n\/\/ Heading Degrees\r\nfloat headingDegrees;\r\n\r\n\/\/ Variable ADXL345 library\r\nADXL345 adxl;\r\n\/\/ Accelerometer ADXL345\r\n\/\/ x, y, z\r\nint x;\r\nint y;\r\nint z;\r\n\/\/ Standard Gravity\r\n\/\/ xyz\r\ndouble xyz[3];\r\ndouble ax;\r\ndouble ay;\r\ndouble az;\r\n\r\n\/\/ FullString\r\nString FullString = &quot;&quot;;\r\n\r\n\/\/ Bluetooth Serial\r\nBluetoothSerial SerialBT;\r\n\r\n\/\/ Defined ESP32\r\n#define TFT_DC  D2\r\n#define TFT_CS  D6\r\n#define TFT_RST D3\r\n\r\n\/*dc=*\/ \/*cs=*\/ \/*rst=*\/\r\n\/\/ DFRobot Display 240x320\r\nDFRobot_ST7789_240x320_HW_SPI screen(TFT_DC, TFT_CS, TFT_RST);\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;25-08&quot;;\r\n\r\nvoid loop() {\r\n\r\n  \/\/ Accelemeter ADXL345\r\n  isADXL345();\r\n\r\n  \/\/ Compass HMC5883L\r\n  isHMC5883L();\r\n\r\n  \/\/ Accelemeter ADXL345 Compass HMC5883L Display\r\n  isDisplayADXL345HMC5883L();\r\n\r\n  \/\/ Delay 0.5 Second\r\n  delay( 500 );\r\n\r\n}\r\n<\/pre>\n<p><strong>getAccelemeterADXL345.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Accelemeter ADXL345\r\n\/\/ Setup Accelemeter ADXL345\r\nvoid isSetupADXL345(){\r\n\r\n  \/\/ Power On\r\n  adxl.powerOn();\r\n\r\n  \/\/ Set activity inactivity thresholds (0-255)\r\n  \/\/ 62.5mg per increment\r\n  adxl.setActivityThreshold(75);\r\n  \/\/ 62.5mg per increment\r\n  adxl.setInactivityThreshold(75);\r\n  \/\/ How many seconds of no activity is inactive?\r\n  adxl.setTimeInactivity(10);\r\n \r\n  \/\/look of activity movement on this axes - 1 == on; 0 == off \r\n  adxl.setActivityX(1);\r\n  adxl.setActivityY(1);\r\n  adxl.setActivityZ(1);\r\n \r\n  \/\/look of inactivity movement on this axes - 1 == on; 0 == off\r\n  adxl.setInactivityX(1);\r\n  adxl.setInactivityY(1);\r\n  adxl.setInactivityZ(1);\r\n \r\n  \/\/ Look of tap movement on this axes - 1 == on; 0 == off\r\n  adxl.setTapDetectionOnX(0);\r\n  adxl.setTapDetectionOnY(0);\r\n  adxl.setTapDetectionOnZ(1);\r\n \r\n  \/\/ Set values for what is a tap, and what is a double tap (0-255)\r\n  \/\/ 62.5mg per increment\r\n  adxl.setTapThreshold(50);\r\n  \/\/ 625us per increment\r\n  adxl.setTapDuration(15);\r\n  \/\/ 1.25ms per increment\r\n  adxl.setDoubleTapLatency(80);\r\n  \/\/ 1.25ms per increment\r\n  adxl.setDoubleTapWindow(200);\r\n \r\n  \/\/ set values for what is considered freefall (0-255)\r\n  \/\/ (5 - 9) recommended - 62.5mg per increment\r\n  adxl.setFreeFallThreshold(7);\r\n  \/\/ (20 - 70) recommended - 5ms per increment\r\n  adxl.setFreeFallDuration(45);\r\n \r\n  \/\/ Setting all interrupts to take place on int pin 1\r\n  \/\/ I had issues with int pin 2, was unable to reset it\r\n  adxl.setInterruptMapping( ADXL345_INT_SINGLE_TAP_BIT,   ADXL345_INT1_PIN );\r\n  adxl.setInterruptMapping( ADXL345_INT_DOUBLE_TAP_BIT,   ADXL345_INT1_PIN );\r\n  adxl.setInterruptMapping( ADXL345_INT_FREE_FALL_BIT,    ADXL345_INT1_PIN );\r\n  adxl.setInterruptMapping( ADXL345_INT_ACTIVITY_BIT,     ADXL345_INT1_PIN );\r\n  adxl.setInterruptMapping( ADXL345_INT_INACTIVITY_BIT,   ADXL345_INT1_PIN );\r\n \r\n  \/\/ Register interrupt actions - 1 == on; 0 == off  \r\n  adxl.setInterrupt( ADXL345_INT_SINGLE_TAP_BIT, 1);\r\n  adxl.setInterrupt( ADXL345_INT_DOUBLE_TAP_BIT, 1);\r\n  adxl.setInterrupt( ADXL345_INT_FREE_FALL_BIT,  1);\r\n  adxl.setInterrupt( ADXL345_INT_ACTIVITY_BIT,   1);\r\n  adxl.setInterrupt( ADXL345_INT_INACTIVITY_BIT, 1);\r\n\r\n}\r\n\/\/ Accelemeter ADXL345\r\nvoid isADXL345(){\r\n\r\n  \/\/ Read the accelerometer values and store them in variables  x,y,z\r\n  adxl.readXYZ(&amp;x, &amp;y, &amp;z);\r\n\r\n  \/\/ Output\r\n  \/\/ FullString\r\n  \/\/ ************\r\n  FullString = &quot;************\\r\\n&quot;;\r\n  \/\/ FullString Bluetooth Serial + Serial\r\n  for(int i = 0; i &lt; FullString.length(); i++)\r\n  {\r\n    \r\n    \/\/ Bluetooth Serial\r\n    SerialBT.write(FullString.c_str()[i]);\r\n    \/\/ Serial\r\n    Serial.write(FullString.c_str()[i]);\r\n       \r\n  }\r\n  \r\n  \/\/ FullString\r\n  FullString = &quot;Values of X , Y , Z: &quot; + String(x) + &quot; , &quot; + \r\n  String(y) + &quot; , &quot; + String(z) + + &quot;\\r\\n&quot;;\r\n\r\n  \/\/ FullString Bluetooth Serial + Serial\r\n  for(int i = 0; i &lt; FullString.length(); i++)\r\n  {\r\n\r\n    \/\/ Bluetooth Serial\r\n    SerialBT.write(FullString.c_str()[i]);\r\n    \/\/ Serial\r\n    Serial.write(FullString.c_str()[i]);\r\n    \r\n  }\r\n  \r\n  \/\/ Standard Gravity\r\n  \/\/ Acceleration\r\n  adxl.getAcceleration(xyz);\r\n\r\n  \/\/ Output\r\n  ax = xyz[0];\r\n  ay = xyz[1];\r\n  az = xyz[2];\r\n  \r\n  \/\/ FullString\r\n  \/\/ ************\r\n  FullString = &quot;************\\r\\n&quot;;\r\n  \/\/ FullString Bluetooth Serial + Serial\r\n  for(int i = 0; i &lt; FullString.length(); i++)\r\n  {\r\n    \r\n    \/\/ Bluetooth Serial\r\n    SerialBT.write(FullString.c_str()[i]);\r\n    \/\/ Serial\r\n    Serial.write(FullString.c_str()[i]);\r\n       \r\n  }\r\n\r\n  \/\/ FullString\r\n  \/\/ xg\r\n  FullString = &quot;X = &quot; + String(ax) + &quot; g&quot; + &quot;\\r\\n&quot;;\r\n  \/\/ FullString Bluetooth Serial + Serial\r\n  for(int i = 0; i &lt; FullString.length(); i++)\r\n  {\r\n\r\n    \/\/ Bluetooth Serial\r\n    SerialBT.write(FullString.c_str()[i]);\r\n    \/\/ Serial\r\n    Serial.write(FullString.c_str()[i]);\r\n    \r\n  }\r\n  \/\/ yg\r\n  FullString = &quot;y = &quot; + String(ay) + &quot; g&quot; + &quot;\\r\\n&quot;;\r\n  \/\/ FullString Bluetooth Serial + Serial\r\n  for(int i = 0; i &lt; FullString.length(); i++)\r\n  {\r\n\r\n    \/\/ Bluetooth Serial\r\n    SerialBT.write(FullString.c_str()[i]);\r\n    \/\/ Serial\r\n    Serial.write(FullString.c_str()[i]);\r\n    \r\n  }\r\n  \/\/ zg\r\n  FullString = &quot;z = &quot; + String(az) + &quot; g&quot; + &quot;\\r\\n&quot;;\r\n  \/\/ FullString Bluetooth Serial + Serial\r\n  for(int i = 0; i &lt; FullString.length(); i++)\r\n  {\r\n\r\n    \/\/ Bluetooth Serial\r\n    SerialBT.write(FullString.c_str()[i]);\r\n    \/\/ Serial\r\n    Serial.write(FullString.c_str()[i]);\r\n    \r\n  }\r\n\r\n}\r\n<\/pre>\n<p><strong>getCompassHMC5883L.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ HMC5883L Triple Axis Digital Compass\r\n\/\/ Setup HMC5883L\r\nvoid isSetupHMC5883L(){\r\n\r\n  \/\/ Initialize Initialize HMC5883L\r\n  compass.begin();\r\n\r\n  \/\/ Set measurement range\r\n  compass.setRange(HMC5883L_RANGE_1_3GA);\r\n\r\n  \/\/ Set measurement mode\r\n  compass.setMeasurementMode(HMC5883L_CONTINOUS);\r\n\r\n  \/\/ Set data rate\r\n  compass.setDataRate(HMC5883L_DATARATE_30HZ);\r\n\r\n  \/\/ Set number of samples averaged\r\n  compass.setSamples(HMC5883L_SAMPLES_8);\r\n\r\n  \/\/ Set calibration offset\r\n  compass.setOffset(0, 0);\r\n  \r\n}\r\n\/\/ Compass HMC5883L\r\nvoid isHMC5883L(){\r\n\r\n  \/\/ Vector norm\r\n  Vector norm = compass.readNormalize();\r\n\r\n  \/\/ Calculate heading\r\n  heading = atan2(norm.YAxis, norm.XAxis);\r\n\r\n  \/\/ Set declination angle on your location and fix heading\r\n  \/\/ You can find your declination on: http:\/\/magnetic-declination.com\/\r\n  \/\/ (+) Positive or (-) for negative\r\n  \/\/ Latitude: 32\u00b0 39&#039; 7.9&quot; N\r\n  \/\/ Longitude: 115\u00b0 28&#039; 6.2&quot; W\r\n  \/\/ Magnetic Declination: +10\u00b0 35&#039;\r\n  \/\/ Declination is POSITIVE (EAST)\r\n  \/\/ Inclination: 58\u00b0 4&#039;\r\n  \/\/ Magnetic field strength: 45759.1 nT\r\n  \/\/ Formula: (deg + (min \/ 60.0)) \/ (180 \/ M_PI);\r\n  float declinationAngle = (10.0 + (35.0 \/ 60.0)) \/ (180 \/ M_PI);\r\n  heading += declinationAngle;\r\n\r\n  \/\/ Correct for heading &lt; 0deg and heading &gt; 360deg\r\n  if (heading &lt; 0)\r\n  {\r\n    heading += 2 * PI;\r\n  }\r\n\r\n  if (heading &gt; 2 * PI)\r\n  {\r\n    heading -= 2 * PI;\r\n  }\r\n\r\n  \/\/ Convert to degrees\r\n  headingDegrees = heading * 180\/M_PI; \r\n\r\n  \/\/ Output\r\n  \/\/ FullString\r\n  \/\/ ************\r\n  FullString = &quot;************\\r\\n&quot;;\r\n  \/\/ FullString Bluetooth Serial + Serial\r\n  for(int i = 0; i &lt; FullString.length(); i++)\r\n  {\r\n    \r\n    \/\/ Bluetooth Serial\r\n    SerialBT.write(FullString.c_str()[i]);\r\n    \/\/ Serial\r\n    Serial.write(FullString.c_str()[i]);\r\n    \r\n  }\r\n\r\n  \/\/ FullString\r\n  \/\/ Heading\r\n  FullString = &quot;Heading = &quot; + String( heading ) + &quot;\\r\\n&quot;;\r\n  \/\/ FullString Bluetooth Serial + Serial\r\n  for(int i = 0; i &lt; FullString.length(); i++)\r\n  {\r\n\r\n    \/\/ Bluetooth Serial\r\n    SerialBT.write(FullString.c_str()[i]);\r\n    \/\/ Serial\r\n    Serial.write(FullString.c_str()[i]);\r\n    \r\n  }\r\n\r\n  \/\/ FullString\r\n  \/\/ Degress\r\n  FullString = &quot;Degress = &quot; + String( headingDegrees ) + &quot;\\r\\n&quot;;\r\n  \/\/ FullString Bluetooth Serial + Serial\r\n  for(int i = 0; i &lt; FullString.length(); i++)\r\n  {\r\n\r\n    \/\/ Bluetooth Serial\r\n    SerialBT.write(FullString.c_str()[i]);\r\n    \/\/ Serial\r\n    Serial.write(FullString.c_str()[i]);\r\n    \r\n  }\r\n  \r\n}\r\n<\/pre>\n<p><strong>getDisplay.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ DFRobot Display 240x320\r\n\/\/ DFRobot Display 240x320 - UID\r\nvoid isDisplayUID(){\r\n\r\n  \/\/ DFRobot Display 240x320\r\n  \/\/ Text Display\r\n  \/\/ Text Wrap\r\n  screen.setTextWrap(false);\r\n  \/\/ Rotation\r\n  screen.setRotation(3);\r\n  \/\/ Fill Screen =&gt; black\r\n  screen.fillScreen(0x0000);\r\n  \/\/ Text Color =&gt; white\r\n  screen.setTextColor(0xffff);\r\n  \/\/ Font =&gt; Free Sans Bold 12pt\r\n  screen.setFont(&amp;FreeSansBold12pt7b);\r\n  \/\/ TextSize =&gt; 1.5\r\n  screen.setTextSize(1.5);\r\n  \/\/ Don Luc Electronics\r\n  screen.setCursor(0, 30);\r\n  screen.println(&quot;Don Luc Electronics&quot;);\r\n  \/\/ Accelemeter ADXL345\r\n  screen.setCursor(0, 60);\r\n  screen.println(&quot;Compass HMC5883L&quot;);\r\n  \/\/ Version\r\n  screen.setCursor(0, 90);\r\n  screen.println(&quot;Version&quot;);\r\n  screen.setCursor(0, 120);\r\n  screen.println( sver );\r\n\r\n}\r\n\/\/ Accelemeter ADXL345\r\nvoid isDisplayADXL345HMC5883L(){\r\n\r\n  \/\/ DFRobot Display 240x320\r\n  \/\/ Text Display\r\n  \/\/ Text Wrap\r\n  screen.setTextWrap(false);\r\n  \/\/ Rotation\r\n  screen.setRotation(3);\r\n  \/\/ Fill Screen =&gt; white\r\n  screen.fillScreen(0xffff);\r\n  \/\/ Text Color =&gt; blue\r\n  screen.setTextColor(0x001F);\r\n  \/\/ Font =&gt; Free Sans Bold 12pt\r\n  screen.setFont(&amp;FreeSansBold12pt7b);\r\n  \/\/ TextSize =&gt; 1.5\r\n  screen.setTextSize(1.5);\r\n  \/\/ Accelemeter ADXL345\r\n  screen.setCursor(0, 30);\r\n  screen.println(&quot;Accelemeter ADXL345&quot;);\r\n  \/\/ Accelemeter ADXL345 X\r\n  screen.setCursor(0, 60);\r\n  screen.println(&quot;X: &quot;);\r\n  screen.setCursor(40, 60);\r\n  screen.println( x );\r\n  \/\/ Accelemeter ADXL345 Y\r\n  screen.setCursor(0, 90);\r\n  screen.println( &quot;Y: &quot; );\r\n  screen.setCursor(40, 90);\r\n  screen.println( y );\r\n  \/\/ Accelemeter ADXL345 Z\r\n  screen.setCursor(0, 120);\r\n  screen.println( &quot;Z: &quot; );\r\n  screen.setCursor(40, 120);\r\n  screen.println( z );\r\n  \/\/ Compass HMC5883L\r\n  screen.setCursor(0, 150);\r\n  screen.println( &quot;Compass HMC5883L&quot; );\r\n  \/\/ Heading\r\n  screen.setCursor(0, 180);\r\n  screen.println( &quot;Heading = &quot; );\r\n  screen.setCursor(130, 180);\r\n  screen.println( heading );\r\n  \/\/ Degress\r\n  screen.setCursor(0, 210);\r\n  screen.println( &quot;Degress = &quot; );\r\n  screen.setCursor(130, 210);\r\n  screen.println( headingDegrees );\r\n  \r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup()\r\n{\r\n \r\n  \/\/ Serial Begin\r\n  Serial.begin(115200);\r\n  Serial.println(&quot;Starting BLE work!&quot;);\r\n\r\n  \/\/ Bluetooth Serial\r\n  SerialBT.begin(&quot;DL2501Mk05&quot;);\r\n  Serial.println(&quot;Bluetooth Started! Ready to pair...&quot;);\r\n  \r\n  \/\/ Delay\r\n  delay(100);\r\n\r\n  \/\/ DFRobot Display 240x320\r\n  screen.begin();\r\n\r\n  \/\/ Delay\r\n  delay(100);\r\n\r\n  \/\/ Setup Accelemeter ADXL345\r\n  isSetupADXL345();\r\n\r\n  \/\/ Setup HMC5883L\r\n  isSetupHMC5883L();\r\n\r\n  \/\/ DFRobot Display 240x320 - UID\r\n  \/\/ Don Luc Electronics\r\n  \/\/ Version\r\n  isDisplayUID();\r\n\r\n  \/\/ Delay 5 Second\r\n  delay( 5000 );\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>People can contact us:<\/strong> https:\/\/www.donluc.com\/?page_id=1927<\/p>\n<p><strong>Electronics, IoT, Teacher, Instructor, R&#038;D and Consultant<\/strong><\/p>\n<ul>\n<li>Programming Language<\/li>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Wireless (Radio Frequency, Bluetooth, WiFi, Etc&#8230;)<\/li>\n<li>Robotics<\/li>\n<li>Automation<\/li>\n<li>Camera and Video Capture Receiver Stationary, Wheel\/Tank and Underwater Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial and Marine<\/li>\n<li>Machine Learning<\/li>\n<li>Artificial Intelligence (AI)<\/li>\n<li>RTOS<\/li>\n<li>Sensors, eHealth Sensors, Biosensor, and Biometric<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<li>Consulting<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>Luc Paquin \u2013 Curriculum Vitae &#8211; 2025<\/strong><br \/>\nhttps:\/\/www.donluc.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/@thesass2063<br \/>\n<strong>Twitter:<\/strong> https:\/\/twitter.com\/labs_steam<br \/>\n<strong>Pinterest:<\/strong> https:\/\/www.pinterest.com\/NeoSteamLabs\/<br \/>\n<strong>Instagram:<\/strong> https:\/\/www.instagram.com\/neosteamlabs\/<br \/>\n<strong>Patreon:<\/strong> https:\/\/patreon.com\/DonLucElectronics59<br \/>\n<strong>DFRobot:<\/strong> https:\/\/learn.dfrobot.com\/user-10186.html<br \/>\n<strong>Hackster.io:<\/strong> https:\/\/www.hackster.io\/neosteam-labs<br \/>\n<strong>Elecrow:<\/strong> https:\/\/www.elecrow.com\/share\/sharepj\/center\/no\/760816d385ebb1edc0732fd873bfbf13<br \/>\n<strong>TikTok:<\/strong> https:\/\/www.tiktok.com\/@luc.paquin8<br \/>\n<strong>Twitch:<\/strong> https:\/\/www.twitch.tv\/lucpaquin<br \/>\n<strong>LinkedIn:<\/strong> https:\/\/www.linkedin.com\/in\/jlucpaquin\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #HMC5883L #ADXL345 #Accelerometer #Movement #ESP32 #Bluetooth #Elecrow #DFRobot #Arduino #Project #Patreon #Electronics #Microcontrollers #IoT #Fritzing #Programming #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Crowtail &#8211; 3-Axis Digital Compass Crowtail-3-Axis Compass module, a member of Crowtail family uses I\u00b2C based Honeywell HMC5883L digital compass. This ASIC is equipped with high resolution HMC118X magneto-resistive sensors and &#8230; <a title=\"Project #25 &#8211; Movement &#8211; HMC5883L &#8211; Mk08\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=4270\" aria-label=\"Read more about Project #25 &#8211; Movement &#8211; HMC5883L &#8211; Mk08\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[240,50,49,317,38,368,80,59,115,5,138,287,58,82,10],"tags":[251,6,92,242,102,320,87,369,19,83,85,338,246,24,249,9,84,27,33,34,108],"class_list":["post-4270","post","type-post","status-publish","format-standard","hentry","category-movement","category-arduino","category-consultant","category-dfrobot","category-digitalelectronics","category-elecrow","category-esp32","category-fritzing","category-e-mentor","category-microcontrollers","category-patreon","category-program","category-arduino-programming","category-program-esp32","category-projects","tag-accelerometer","tag-arduino","tag-battery","tag-bluetooth","tag-components","tag-dfrobot","tag-display","tag-elecrow","tag-electronics","tag-esp32","tag-fritzing","tag-hmc5883l","tag-magnetometer","tag-microcontroller","tag-movement","tag-programming","tag-programming-esp32","tag-projects-2","tag-technology","tag-video-blog","tag-vlog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4270","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4270"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4270\/revisions"}],"predecessor-version":[{"id":4275,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4270\/revisions\/4275"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}