#include <SPI.h>
void setup() {
Serial.begin(9600);//9600
// start the SPI library:
SPI.begin();
SPI.setClockDivider(SPI_CLOCK_DIV16);
}
void loop() {
unsigned int BL,BH,dato;
// dato=0;
SPI.transfer(0x87);
delayMicroseconds(1);
BH = SPI.transfer(0);
BL = SPI.transfer(0);
dato = (BH<<8 | BL)>>4;
Serial.println(dato);
delayMicroseconds(10);
}
How can i read the bits of the ADC?
This always send me in the monitor serial the number 2047 with any value of voltage.