Mega 2560 program help

Hi,

I can partly enderstand someone elses sketch but to start from scratch I get lost.

I am using a Mega 2560 to control Temp 2 x Max6675 and 1 x smoke modue MQ_2 to operate a relay via some additional logic circuit.

That code I have modified from "Robojax", the outputs go to a CD4002 Nor gate, pins 10,12 and 13 of the Mega are my output pins which will stay low unless Temp or Smoke trigger, so I will then use pin 8 which will go to a another gate in the circuit, this pin 8 of the Mega to go either high or low for a few seconds so the other 3 pins dont trigger a high on startup.

I dont want to use Delay as I think this stops the program, are Millis or a Bolean statement the best but not sure of the code to use.

Would be grateful for any help advise

Regards John

John40131:
Hi,

I can partly enderstand someone elses sketch but to start from scratch I get lost.

I am using a Mega 2560 to control Temp 2 x Max6675 and 1 x smoke modue MQ_2 to operate a relay via some additional logic circuit.

That code I have modified from "Robojax", the outputs go to a CD4002 Nor gate, pins 10,12 and 13 of the Mega are my output pins which will stay low unless Temp or Smoke trigger, so I will then use pin 8 which will go to a another gate in the circuit, this pin 8 of the Mega to go either high or low for a few seconds so the other 3 pins dont trigger a high on startup.

I dont want to use Delay as I think this stops the program, are Millis or a Bolean statement the best but not sure of the code to use.

Would be grateful for any help advise

Regards John

No schematic.

No code.

= NO HELP !

.

No reason to put Schematic or sketch I am using, just require a statement to create a delay that I can insert in my program.

Posted on this site a few times never get help sort myself

Regards

http://forum.arduino.cc/index.php?topic=503368.0

John40131:
Hi,

I can partly enderstand someone elses sketch but to start from scratch I get lost.

I am using a Mega 2560 to control Temp 2 x Max6675 and 1 x smoke modue MQ_2 to operate a relay via some additional logic circuit.

That code I have modified from "Robojax", the outputs go to a CD4002 Nor gate, pins 10,12 and 13 of the Mega are my output pins which will stay low unless Temp or Smoke trigger, so I will then use pin 8 which will go to a another gate in the circuit, this pin 8 of the Mega to go either high or low for a few seconds so the other 3 pins dont trigger a high on startup.

I dont want to use Delay as I think this stops the program, are Millis or a Bolean statement the best but not sure of the code to use.

Would be grateful for any help advise

Regards John

John40131:
No reason to put Schematic or sketch I am using, just require a statement to create a delay that I can insert in my program.

Posted on this site a few times never get help sort myself

Regards

The amount of help available is directly proportional to the amount of information provided. A little information = a little help.

You may have typed a lot, but there isn't enough or the correct information for someone else (who doesn't have your hardware or libraries and can't see your setup) to help you much.

Based on the information you have provided the only answer available is: yes, using millis() is many many times better than delay. See the link Using millis() for timing. A beginners guide (and it is the same link provided above by groundFungus)