Docedison:
Is it possible that you have to ask the decoder for something first? Perhaps absolute position? or that it might require some kind of calibration/initialization or reset first time it's used or powered up?Doc
I found this doc http://www.cui.com/product/resource/amt203-appnote.pdf
it tells you exactly what to send here is the updated code i am using
.
#include <SPI.h>
void setup()
{
SPI.begin();
pinMode(3,OUTPUT);//Slave Select
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(SPI_MODE0);
SPI.setClockDivider(SPI_CLOCK_DIV32);
digitalWrite(3,LOW);
byte response = SPI.transfer(0x00);
digitalWrite(3,HIGH);
Serial.begin(9600);
}
void loop()
{
digitalWrite(3,LOW);
byte response = SPI.transfer(0x10);
digitalWrite(3,HIGH);
Serial.print("I received: ");
Serial.print(response, BIN);
Serial.print(" this has an ASCII value of ");
Serial.println(response ,DEC);
delay(2000);
}
I am still getting weird numbers...
I found out the datasheet page 4 of it with all information needed http://www.cui.com/product/resource/amt203-appnote.pdf
i still can't figure what why my code is not working