รหัสสินค้า | A23 |
หมวดหมู่ | Accelerometers / Gyros / Compasses |
ราคา | 60.00 บาท |
สถานะสินค้า | พร้อมส่ง |
ลงสินค้า | 26 พ.ค. 2560 |
อัพเดทล่าสุด | 20 พ.ย. 2567 |
คงเหลือ | 81 ชิ้น |
จำนวน | ชิ้น |
The device has five pins. In most applications (and this tutorial), you will only be concerned with four of them.
This is a pretty complicated device, that by itself could take pages to describe. This tutorial simply highlights the basics.
The Honeywell HMC5883L sensor used in the module is sensitive to the earths magnetic fields in three axes. These axes are labeled as X, Y, and Z. An output is provided for each of these axes that describes the position of these axes relative to the earth’s magnetic field.
As illustrated, twisting or turning the device will provide the corresponding outputs.
In this tutorial, you will connect the GY-273, load a basic sketch and see an output to your serial monitor. The purpose of this tutorial is to verify that you can read and output and to
Just four connections are required. Refer to the picture below.
#include <Wire.h> //I2C Arduino Library #define addr 0x1E //I2C Address for The HMC5883 void setup(){ Serial.begin(9600); Wire.begin(); Wire.beginTransmission(addr); //start talking Wire.write(0x02); // Set the Register Wire.write(0x00); // Tell the HMC5883 to Continuously Measure Wire.endTransmission(); } void loop(){ int x,y,z; //triple axis data //Tell the HMC what regist to begin writing data into Wire.beginTransmission(addr); Wire.write(0x03); //start with register 3. Wire.endTransmission(); //Read the data.. 2 bytes for each axis.. 6 total bytes Wire.requestFrom(addr, 6); if(6<=Wire.available()){ x = Wire.read()<<8; //MSB x x |= Wire.read(); //LSB x z = Wire.read()<<8; //MSB z z |= Wire.read(); //LSB z y = Wire.read()<<8; //MSB y y |= Wire.read(); //LSB y } // Show Values Serial.print("X Value: "); Serial.println(x); Serial.print("Y Value: "); Serial.println(y); Serial.print("Z Value: "); Serial.println(z); Serial.println(); delay(500); }
Your output should look something like this. Once you’ve established that you have an output, try turning your device along it’s various axes and view the results.
ชำระเงินค่าสินค้าโดยการโอนเงินเข้าบัญชีด้านล่าง โดยลูกค้าสามารถโอนเงินหลังทำรายการสั่งซื้อได้ทันทีไม่ต้องรอยืนยัน
หลังจากโอนเงินแล้วสามารถแจ้งชำระเงินได้ที่ เมนูแจ้งชำระเงิน
หรือชำระเงินผ่าน PayPal โดยคลิกที่ ชำระเงินออนไลน์
หน้าที่เข้าชม | 1,830,072 ครั้ง |
ผู้ชมทั้งหมด | 799,072 ครั้ง |
เปิดร้าน | 12 ธ.ค. 2558 |
ร้านค้าอัพเดท | 7 ก.ย. 2568 |