AMS AS5600 Manual - Página 8
Navegue en línea o descargue pdf Manual para Unidad de control AMS AS5600. AMS AS5600 14 páginas. 12-bit programmable contactless potentiometer
También para AMS AS5600: Manual de instrucciones (12 páginas), Manual del usuario (13 páginas), Manual de instrucciones (10 páginas)
- 1. Table of Contents
- 1. 1 Introduction
- 1. Kit Content
- 2. 2 Board Description
- 3. 3 Software
- 3. Labview
- 3. Using the Arduino IDE
- 3. Installing the Arduino Library
- 3. Reading out the AS5600 Sensor
- 4. 4 AS5600-POTUINO Hardware
- 4. AS5600-POTUINO Schematics
- 4. AS5600-POTUINO PCB Layout
- 5. 5 Ordering & Contact Information
- 6. 6 Copyrights & Disclaimer
AS5600 Adapter Board
3.2.2 Reading out the AS5600 sensor
Source code examples are also available for download on the ams webpage.
Following source code shows an easy example of reading out the sensor:
/*------------------------------------------------------
FILE:
AS5600
Author: Mark A. Hoferitza, Field Application Engineer, ams AG
www.ams.com
Date: 27 May 2014
Description:
Development of sketches for AS5600 "Potuino"
Read Raw Angle and Angle.
Single Value, no averaging.
-------------------------------------------------------*/
#include <Wire.h>
int AS5600_ADR = 0x36;
const int raw_ang_hi = 0x0c;
const int raw_ang_lo = 0x0d;
const int ang_hi = 0x0e;
const int ang_lo = 0x0f;
const int stat = 0x0b;
const int agc = 0x1a;
const int mag_hi = 0x1b;
const int mag_lo = 0x1c;
void setup(){
Serial.begin(9600);
Wire.begin();
}
void startup(){
}
void loop(){
//
Wire.beginTransmission(AS5600_ADR);
//
Wire.write(0x);
//
Wire.write(0x00);
//
Wire.endTransmission();
//***************************************************************
// Read Raw Angle Low Byte
Wire.beginTransmission(AS5600_ADR);
Wire.write(raw_ang_lo);
Wire.endTransmission();
Wire.requestFrom(AS5600_ADR, 1);
while(Wire.available() == 0);
int lo_raw = Wire.read();
// Read Raw Angle High Byte
Wire.beginTransmission(AS5600_ADR);
Wire.write(raw_ang_hi);
Wire.endTransmission();
Wire.requestFrom(AS5600_ADR, 1);
while(Wire.available() == 0);
word hi_raw = Wire.read();
hi_raw = hi_raw << 8;
hi_raw = hi_raw | lo_raw;
//**********************************************************
// Read Angle Low Byte
ams Eval Kit Manual, Confidential
[v1-0] 2015-Jan-21
//shift raw angle hi 8 left
//AND high and low raw angle value
Page 8
Document Feedback