hello every one ... i m beginner
i need a programe that control an relay with time ... 1 minute on and 8 minute off
please help me
thanx
hello every one ... i m beginner
i need a programe that control an relay with time ... 1 minute on and 8 minute off
please help me
thanx
Is the program going to do anything else ?
If not then the delay() function will enable you to do what you want but will not provide long term accuracy. How accurate does the timing have to be ?
What have you tried so far ?
Welcome!
Show us what you have so far.
Always show us your ‘current’ compete sketch.
Use CTRL T to format the sketch.
Please use code tags.
Use the </> icon in the posting menu.
[code] Paste sketch here. [/code]
Show us a good schematic of your circuit.
Show us a good image of your wiring.
This is where I started:
open your IDE
open the example of blink without delay
using delay() blocks anything else but the timer.
blink without delay shows you how to use the internal clock as a way to do things over time.
by the way, you should read how to use this forum. it is at the top of every fourm.
and learn how to post your code.
and a hint for this project would be to use 2 seconds and 10 seconds.
sitting and waiting 8 minutes would be a PITA.
UKHeliBob:
Is the program going to do anything else ?If not then the delay() function will enable you to do what you want but will not provide long term accuracy. How accurate does the timing have to be ?
What have you tried so far ?
no ... just an relay 1 minute on ...8 minute off
Ok, so what progress have you made in the last four of five days?
Post your code.
Hello.As you can understand no one is going to provide you any help without showing at least an effort of you.Believe me i am a beginner and i got a lot of help here but at least i made some efforts either with plans or a little code.I am still learning and spend time.
below is a very simple code that i did for your occasion,with the use of delay. Althought i don't like delay function because it stops the programs, this is one solution.With the use of millis could be more reliable.
const int relayPin=2;
void setup(){
pinMode(relayPin,OUTPUT);
}
void loop(){
digitalWrite(relayPin,HIGH);
delay(60000); //for 1 minute
digitalWrite(relayPin,LOW);
delay(480000); //for 8 minutes
}
With the use of millis could be more reliable.
It would not be any more reliable (or accurate) if it used millis() and if it does what the OP says he/she wants then 2 delay()s is a good enough solution.