Thermistor and Motor design

I am trying to write the code and design on the breadboard a thermistor which displays the temperature on a LCD display, which turns on a fan blade (3-6V) motor when it gets to 28 Degrees and flashes an LED when it gets to 30 degrees. I am using a power supply for the motor and the Elegoo UNO R3 controller board.

This is the code ive wrote so far:
#include <LiquidCrystal.h>
int tempPin = 0;
// BS E D4 D5 D6 D7
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
#define ENABLE 5
#define DIRA 3
#define DIRB 4
int i;
void setup() {
// put your setup code here, to run once:
lcd.begin(16, 2);
//—set pin direction
pinMode(ENABLE,OUTPUT);
pinMode(DIRA,OUTPUT);
pinMode(DIRB,OUTPUT);
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
int tempReading = analogRead(tempPin);
// This is OK
double tempK = log(10000.0 * ((1024.0 / tempReading - 1)));
tempK = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * tempK * tempK )) * tempK );
// Temp Kelvin
float tempC = tempK - 273.15; // Convert Kelvin to Celcius
float tempF = (tempC * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit
/* replaced
float tempVolts = tempReading * 5.0 / 1024.0;
float tempC = (tempVolts - 0.5) * 10.0;
float tempF = tempC * 9.0 / 5.0 + 32.0;
*/
// Display Temperature in C
lcd.setCursor(0, 0);
lcd.print("Temp C ");
// Display Temperature in F
//lcd.print("Temp F ");
lcd.setCursor(6, 0);
// Display Temperature in C
lcd.print(tempC);
// Display Temperature in F
//lcd.print(tempF);
delay(500);
//—back and forth example
Serial.println(“One way, then reverse”);
digitalWrite(ENABLE,HIGH); // enable on
for (i=0;i<5;i++) {
digitalWrite(DIRA,HIGH); //one way
digitalWrite(DIRB,LOW);
delay(500);
;

}

}

Is there a question?

(I deleted this topic's twin)

Please remember to use code tags when posting code

for (i=0;i<5;i++) {
digitalWrite(DIRA,HIGH); //one way
digitalWrite(DIRB,LOW);
delay(500);
;

}

Probably does not do what you had it mind.

I don't actually know how to write the code for what I've been asked to do. This is a project I have been set and the code which I posted is as far as ive got. I'd appreciate any help!

If you want informed help, please read the "How to use this forum" post, correct your first post to add code tags, and clearly explain the problem.

I don’t think the OP is taking the hint. He’s now posted yet another version of this same non-question https://forum.arduino.cc/index.php?topic=588079.msg3999974#msg3999974

Steve

slipstick: I don't think the OP is taking the hint. He's now posted yet another version of this same non-question https://forum.arduino.cc/index.php?topic=588079.msg3999974#msg3999974

Steve

That's three versions of the same topic. Shame.