Moderators: adafruit_support_bill, adafruit
ribo wrote:If I'm using the MAX31855 directly on the arduino pins 7-2, how do I set pins 4,3,2 to GND, 3Vo, Vin respectively?
The example sketch doesn't handle anything other than the DO, CS, CLK.
Is the 3V input optional for systems that do not run at 5V
double Adafruit_MAX31855::readCelsius(void) {
uint32_t v;
v = spiread32();
//Serial.print("0x"); Serial.println(v, HEX);
float internal = (v >> 4) & 0x1FF;
internal *= 0.0625;
if ((v >> 4) & 0x200)
internal *= -1;
//Serial.print("Internal Temp: "); Serial.println(internal);
if (v & 0x7) {
// uh oh, a serious problem!
return NAN;
}
v >>= 18;
//Serial.println(v, HEX);
double temp = v & 0x7FF;
if (v & 0x800) temp *= -1;
temp *= 0.25;
return temp;
}
v >>= 18;
//Serial.println(v, HEX);
double temp = v & 0x7FF;
if (v & 0x800) temp *= -1;
temp *= 0.25;
return temp;
Return to Other Arduino products from Adafruit
Users browsing this forum: franklin97355 and 3 guests