HMC5883 5883电子指南针/罗盘

来自Duinopeak_COM
跳转至: 导航搜索

英文

产品简介

电子指南针罗盘HMC5883L是三轴磁阻传感器,用来测量周围的磁感应强度,测量范围-8g~8g单位是高斯。提到磁感应强度最熟悉的应该是高中时学的B单位T特斯拉,其实高斯也是磁感应强度单位,只不过高斯是很小的单位,10000高斯等于1特斯拉。网上是这么定义的:一段导线,若放在磁感应强度均匀的磁场中,方向与磁感应强度方向垂直的长直导在线通有1电磁系单位(emu)的稳恒电流(等于10安培)时,在每厘米长度的导线受到电磁力为1达因,则该磁感应强度就定义为1高斯。即1T(特斯拉)=10000g(高斯)


HCM5883 Breakout-1.jpgHCM5883 Breakout-2.jpg

特征

  • 尺寸:20*20mm
  • 重量:1.5g

技术参数

  • 操作电压:2.16~3.6DCV
  • 接口:IIC

应用示例


Hello world.png

下面的例子演示了如何用Puzzle- Button来开或关LED。

 //Turns on and off a light emitting diode(LED) connected to digital pin 13, when pressing a pushbutton attached to pin 2. 
 /*
 The circuit:
 * LED attached from pin 13 to ground 
 * pushbutton attached to pin 2 from +5V
 * 10K resistor attached to pin 2 from ground
 * Note: on most Arduinos there is already an LED on the board
 attached to pin 13.
 This example code is in the public domain.
 http://www.arduino.cc/en/Tutorial/Button
 */
 // constants won't change. They're used here to 
 // set pin numbers:
 const int buttonPin = 2;     // the number of the pushbutton pin
 const int ledPin =  13;      // the number of the LED pin
 // variables will change:
 int buttonState = 0;         // variable for reading the pushbutton status
 void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);      
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);     
 }
 void loop(){
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);
  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {     
    // turn LED on:    
    digitalWrite(ledPin, HIGH);  
  } 
  else {
    // turn LED off:
    digitalWrite(ledPin, LOW); 
  }
 }


资源


购买

支持

如果你有什么困难或者好的点子, 你可以来我们的DuinoPeak论坛参与讨论.

外部链接

链接到外部网页将会给你提供更多应用创意,文档/数据表或软件库

视频