Serial.print ("Max Value: ") Serial.print(sensor.max_value) Serial.println(" m/s^2") Serial.print ("Unique ID: ") Serial.println(nsor_id) Serial.print ("Driver Ver: ") Serial.println(sensor.version) Serial.print ("Sensor: ") Serial.println(sensor.name) * Assign a unique ID to this sensor at the same time */Īdafruit_ADX元45_Unified accel = Adafruit_ADX元45_Unified(12345) The example sketch is as shown: #include We also need to install the Unified Sensor library:Īfter installation of the libraries, go to Files > Examples > Adafruit ADX元45 > sensortest. On the search field, type "Adafruit ADX元45", press enter and the library should appear. 1.8.9) then go to Tools > Manage Libraries… Setting Up Arduino IDEįirst, we need the ADX元45 Arduino library. If you own a different board, rest assure that the sketches in this tutorial will still work as long as the correct wiring is followed. This tutorial will focus on the ADX元45 breakout board as shown: The acceleration forces can be static (due to gravity only) or dynamic (due to motion and gravity).Ī more in-depth look at the ADX元45 is accessible via its datasheet: The ADX元45 can measure acceleration in as much as ☒g with an option to change the maximum to ±4g, ☘g and ☑6g. Hence, the ADX元45 gives acceleration forces in g units, g being the acceleration due to gravity equal to 9.8 m/s 2. If an object is at rest, only the force of gravity is acting on it. In reality, the ADX元45 is capable of measuring acceleration forces in the x, y and z axes.Īcceleration force is the force that causes an object to move. This tutorial aims to show how you can interface this accelerometer with an Arduino. Like most sensors, this device comes with an easy-to-use breakout board and is usable through SPI or I2C. The ADX元45 is an integrated circuit that measures acceleration in 3 axes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |