Temperature difference from two thermistors

I have a mega 2560 and ramps 1.4. I am wanting to be able to measure temp difference from two thermistors and when the difference gets to 5 degrees for 10 minutes I want power to be sent to the D8 terminal .The normal range is around 20 degrees. I need code for this. Im a noob and this is probably pretty basic but I have no clue where to start with the code. If someone could at least steer me in the right direction, it would be greatly appreciated. Also there is no need for a display.

What is ramps 1.4 ?

Anyway, this sounds very much like a homework problem.

You should do your own work.

Start by learning to measure temperature with an Arduino and a thermistor. There are lots of tutorials on line.

I agree... Take it one step at a time...

Once you can measure one temperature you can measure two temperatures.

Once you've got two temperatures, subtract and use a if-statement to take action if the difference is greater than 5 degrees.

Then add a 10-minute loop (using the Blink Without Delay) example.

I want power to be sent to the D8 terminal

What are you gong to "power"? The I/O pins can't directly power much more than an LED and for anything more than that you'll need some additional circuitry.

...Personally, I wouldn't use a thermistor. An LM34 or LM35 is easier to use because they are linear and that makes the software easier and they are quite accurate without calibration.

Ramps 1.4 is the servo & heater control part of a 3D printer.

Many printers use a combined board:

First off thank you for your comments and suggestions, except for iee488, you could have just went to the next post, if you don't know what ramps 1.4 is then it sounds like you need to do your homework. The only reason I have these boards is because I built a 3d printer and I know you can do all kinds of different stuff with the arduino and like I said I am not in any way a expert in this field, I am learning and I am looking for guidance, hence the sub category "project guidance" iee488. If you cant ask questions on this forum then what is the point of this forum??

I was thinking I could use the ramps board because you use a 12v power supply so I figured that would definitely be good enough for what I am trying to do. I am going to use it to power the coil of a relay. I know in marlin it already has the code and settings for the thermistors that I already have so im not too worried about that part. I just wasn't sure how I would work out the temp difference, but thank you DVDdoug that helps a lot. Now I just need to figure out how to control the D8 terminal. I should have been more specific with my first post. Any additional help is greatly appreciated.