// digitalWrite(SS, LOW); SPI.transfer(READ01); // send a value of 0 to read the first byte returned: result_blank = SPI.transfer(0x00); // decrement the number of bytes left to read: result = SPI.transfer(0x00); // if you still have another byte to read: for(int i = 0;i<2;i++) { // shift the first byte left, then get the second byte: result = result << 8; inByte = SPI.transfer(0x00); // combine the byte you just got with the previous one: result = result | inByte; // decrement the number of bytes left to read: } // take the chip select high to de-select: //digitalWrite(SS, HIGH); // return the result: Serial.print("Valor recebido: "); Serial.println(result,BIN); ; return(result);}

// digitalWrite(SS, LOW); SPI.transfer(READ02); // send a value of 0 to read the first byte returned: result_blank = SPI.transfer(0x00); // decement the number of bytes left to read: result = SPI.transfer(0x00); // if you still have another byte to read: for(int i = 0;i<2;i++) { // shift the first byte left, then get the second byte: result = result << 8; inByte = SPI.transfer(0x00); // combine the byte you just got with the previous one: result = result | inByte; // decrement the number of bytes left to read: } // take the chip select high to de-select: //digitalWrite(SS, HIGH); // return the result: Serial.print("Valor recebido: "); Serial.println(result,BIN); return(result);}