Assume that i have real time clock. I wanna min value of time and recorded in variable once @ time. I could able to reset the variable after 10 min . can some help me how can we achieve this
pseudo code:
previous value<--preset value
check ( present value-previous value== 10 min)
if yes
reset preset value and print hello
what i wanna do is keep updating previous value with new newly recorded value of time.
Assume i have time 10h10m10s
assume previous value has 00m @ start
now hence 10 min passed it will update previous value to 10 from 0 and current value keep incrementing..
when(current value-previous value is 10 min )
update previous to current and print message
else incrementing current value
Can some one share me the simple code where i can update the current value to previous value.
assume i have RTC , Where i wanna record time for every 10 min with current one. reason i wanna do that for every 10 min i wanna actuate motor.
pseudo code :
previous time = current time:
if ( current time-previous time>=10 min)
print "hello" and update previous time == current time and turn on motor
else
print "welcome" and keep counting current time and turn off motor
i need simple c code for above .
i am using arduino board uno board.i don't want use delay timer .since some code might get affected
How can simple c code for arduino UNO board to update the values every 10 min
assume i have motor and rtc
pseudo code i am looking for:
previous time =0;
current time ;
if (current time -previous time ==10 min)
print hello, update previous time to current time and turn on the motor
else
print welcome , current value keep incrementing till 10 min reached and turn off motor
i don't want use delay function here . Using normal counter or variable how can achieve above code.previous time recorded one @ time and get updated after it complete 10 min.
previous value get update current value only first time execution
after that difference should get varied .
after completion of 10 min . previous value get updated with the current .motor should start
i have mentioned that i have real time clock. where i am getting time
There are PLENTY of RTC code in either here or project guidence, that do something after a certain time has passed. Most, if not ALL have examples. Find them, read them, learn from them, and write your own. Come back when you have an actual code that compiles or at least has some errors that make sense based on what you wrote.
i checked in forum but i could not able to fined it. Can some help me writing code .
I know psedo code write:
Assume i have rtc and motor
I have attached RTC code below. where i am getting date and time for set values.
now,I wanted to reset the previous time to current time every 10 min.when updatd motor get on and led pin 13 should high
pseudo code
previous time ==0; intially
current time = m;
check( current time- previous time)>10=10 min)
if yes previous time== current time, motor on, led 13 goes high
if not current time ++; motor should off , led 13 goes low
HazardsMind:
There are PLENTY of RTC code in either here or project guidence, that do something after a certain time has passed. Most, if not ALL have examples. Find them, read them, learn from them, and write your own. Come back when you have an actual code that compiles or at least has some errors that make sense based on what you wrote.
yes i wanna wait for 10 min, When difference is equal to 10 min motor should on few min and led goes high ,
when difference less than 10 min it should be off and led pin goes low
Have you had a look at the BlinkWithoutDelay example in the IDE ?
That essentially does what you want. It waits a while (you define the waiting time), turns on an LED, waits a while then turns it off. As it stands the on/off periods are equal but you could change that behaviour.