停售
停售
商品簡介 |
為了完善我們的加速度計產品,我們現在擁有來自 Analog Devices 的非 ADXL345,這是一款具有數字 I2C 和 SPI 接口分支的三軸加速度計。 添加了一個板載 3.3V 穩壓器和邏輯電平轉換電路,使其成為與任何 3V 或 5V 微控制器(如 Arduino)接口的完美選擇。
該感測器具有三個測量軸 X Y Z 和可用作 I2C 或 SPI 數字接口的引腳。 您可以將靈敏度級別設置為 +-2g、+-4g、+-8g 或 +-16g。 較低的範圍為慢動作提供更高的分辨率,較高的範圍有利於高速跟踪。 ADXL345 是 ADI 公司最新、最出色的產品,以其卓越品質的 MEMS 器件而聞名。 VCC 輸入高達 5V,並通過輸出引腳將其調節至 3.3V。
完全組裝和測試。 隨附 9 針 0.1" 標準接頭,以防您想將其與麵包板或穿孔板一起使用。兩個 2.5 毫米安裝孔便於安裝。
立即開始使用適用於 ADXL345 的 Adafruit Arduino 程式庫! 只需將 VIN 引腳連接到 3-5V 電源,GND 到地,SCL 到 I2C 時鐘(在 UNO 上也稱為 A5),SDA 到 I2C 數據(在 UNO 上也稱為 A4)。 然後下載庫並解壓。 重命名 Adafruit_ADXL345 中的文件夾並檢查它是否包含 .cpp 和 .h 文件。 將該文件夾放入您的 Arduino 庫文件夾中。 如果您的第一個庫安裝,請查看我們關於。程式庫網址
文件下載 |
如何查詢I2C位址 |
STEP 1. 將欲查詢的模組連接至Arduino UNO(附圖為腳位參考,實際請比對商品標示接線)
STEP 2. 開啟Arduino IDE並新增檔案
STEP 3. 貼入教學下方的範例文件,並上傳到Arduino UNO,即會開始掃描I2C位址
STEP 4. 開啟序列埠監控視窗,即可取得I2C位址
/ ---------------------------------------------------------------- / | |
// Arduino I2C Scanner | |
// Re-writed by Arbi Abdul Jabbaar | |
// Using Arduino IDE 1.8.7 | |
// Using GY-87 module for the target | |
// Tested on 10 September 2019 | |
// This sketch tests the standard 7-bit addresses | |
// Devices with higher bit address might not be seen properly. | |
/ ---------------------------------------------------------------- / | |
#include |
|
void setup() | |
{ | |
Wire.begin(); // Wire communication begin | |
Serial.begin(9600); // The baudrate of Serial monitor is set in 9600 | |
while (!Serial); // Waiting for Serial Monitor | |
Serial.println("\nI2C Scanner"); | |
} | |
void loop() | |
{ | |
byte error, address; //variable for error and I2C address | |
int nDevices; | |
Serial.println("Scanning..."); | |
nDevices = 0; | |
for (address = 1; address < 127; address++ ) | |
{ | |
// The i2c_scanner uses the return value of | |
// the Write.endTransmisstion to see if | |
// a device did acknowledge to the address. | |
Wire.beginTransmission(address); | |
error = Wire.endTransmission(); | |
if (error == 0) | |
{ | |
Serial.print("I2C device found at address 0x"); | |
if (address < 16) | |
Serial.print("0"); | |
Serial.print(address, HEX); | |
Serial.println(" !"); | |
nDevices++; | |
} | |
else if (error == 4) | |
{ | |
Serial.print("Unknown error at address 0x"); | |
if (address < 16) | |
Serial.print("0"); | |
Serial.println(address, HEX); | |
} | |
} | |
if (nDevices == 0) | |
Serial.println("No I2C devices found\n"); | |
else | |
Serial.println("done\n"); | |
delay(5000); // wait 5 seconds for the next I2C scan | |
} |
出貨清單 |