Pages: 1 [2]   Go Down
Author Topic: programming help  (Read 681 times)
0 Members and 1 Guest are viewing this topic.
DELHI
Online Online
God Member
*****
Karma: 0
Posts: 593
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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











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.

No code, no help.

* code.zip (1.41 KB - downloaded 7 times.)
Logged

AMPS

East Anglia (UK)
Offline Offline
Faraday Member
**
Karma: 89
Posts: 3453
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am having trouble understanding what you want to do.

Your pseudo code seems to come down to "wait 10 mins then turn the LED and motor on"
Is that what you want or do you want ?
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

DELHI
Online Online
God Member
*****
Karma: 0
Posts: 593
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

AMPS

East Anglia (UK)
Offline Offline
Faraday Member
**
Karma: 89
Posts: 3453
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Pages: 1 [2]   Go Up
Jump to: