 #include <SPI.h>
+#include <math.h>
 
 // testing a stepper motor with a Pololu A4988 driver board or equivalent
 // on an Uno the onboard led will flash with each step

float upTime = 0.5; //sec
int platTime = 4; //sec
int thermNozzle = 0;

void setup() {
  pinMode(13, OUTPUT);
  Serial.begin(9600);

//  pinMode(slaveSelectPin, OUTPUT);


void loop() {
  digitalWrite(13, HIGH);
//  float resistance = 4700.0*5.0/(1.0*analogRead(thermNozzle)*TO_VOLTS)-4700;
  float resistance = 4700.0*1.0/(5/(1.0*analogRead(thermNozzle)*TO_VOLTS)-1);
  String tov = "To Volts: " + String(TO_VOLTS, 9);
  String res = "Resist: " + String(resistance);
  String rinf = "R_INF: " + String(R_INF, 9);
  Serial.println(tov);
  Serial.println(res);
  Serial.println(rinf);
  float temp = BETA/log(resistance/R_INF)-273.15;
  Serial.println(analogRead(thermNozzle));
  Serial.println(temp);
  delay(1000);
  digitalWrite(13, LOW);
  delay(50);
}
