• Increase font size
  • Default font size
  • Decrease font size
  • default color
  • cyan color
  • red color

Arduino.TW樂園

Member Area
ADXL330 與 Arduino連接方法 PDF 列印 E-mail
作者是 xlinx   
週一, 15 一月 2007 18:53

1. 連接sparkfun查看ADXL335的模組與datasheet

  • 這顆模組只能直接輸入1.8V~3.6V,因此必須用arduino board上的3V3輸出腳位(不可接5V,會燒毀元件)
  • 此模組可以偵測x, y, z 三個軸向的加速度值
  • 最大可達正3g以及負3g
  • ST=Self-Test 通常給一個Vs的電壓就能夠激發

 

2. 電路連接

3. code


 
int z = 0;   
int x = 1;
int y = 2;
int xout = 0;
int yout = 0;
int zout = 0;
 
void setup() {
  Serial.begin(9600);
}
 
void loop() {
  xout = analogRead(x);
  yout = analogRead(y);
  zout = analogRead(z);
 
  Serial.print(" X : ");
  Serial.print(xout);
  Serial.print(", Y : ");
  Serial.print(yout);
  Serial.print(", Z : ");
  Serial.println(zout);
  delay(125);                
 
}
 

[download code]

4. 結果


blog comments powered by Disqus
最近更新在 週四, 03 六月 2010 13:39