Global Moderator
UK
Offline
Brattain Member
Karma: 143
Posts: 19370
I don't think you connected the grounds, Dave.
|
 |
« Reply #90 on: January 10, 2013, 10:10:26 am » |
but the use milis, why did i get a RTC then? "millis" tells you the time that has elapsed since the last reset. An RTC should retain the time even if the processor is reset or powered-off. "millis" and "micros" also give you the time in smaller increments than most RTCs.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
South Africa
Offline
Newbie
Karma: 0
Posts: 47
|
 |
« Reply #91 on: January 10, 2013, 10:12:57 am » |
I Know HazardsMind it was aimed at AWOL You been helping a lot thank you
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 143
Posts: 19370
I don't think you connected the grounds, Dave.
|
 |
« Reply #92 on: January 10, 2013, 10:22:16 am » |
it was aimed at AWOL OK, bye.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
South Africa
Offline
Newbie
Karma: 0
Posts: 47
|
 |
« Reply #93 on: January 10, 2013, 12:28:35 pm » |
AWOL i am a pc Tech and the obvious things for me is not so obvious for the public i work with, sometimes i cant understand why they don't understand things that is second nature to me. So i know why you getting fed up with me asking so much, i don't understand the obvious to you, hence the questions. I felt today like the ppl that come to me for advice, there is no excuse for my behavior. I am sorry for shouting at you
|
|
|
|
|
Logged
|
|
|
|
|
South Africa
Offline
Newbie
Karma: 0
Posts: 47
|
 |
« Reply #94 on: January 11, 2013, 12:53:26 am » |
For ppl that is interested in te code to control a pin with a RTC here is the code. The pin(in this case  will be high for the ten secs the if statement is true. After ten secs the pin will go low #include <Wire.h> #include "RTClib.h"
RTC_DS1307 RTC; int ledPin = 8;
void setup() { Serial.begin(9600); Wire.begin(); RTC.begin();
RTC.adjust(DateTime(__DATE__, __TIME__)); pinMode (ledPin, OUTPUT); }
void loop() { DateTime now = RTC.now(); Serial.print(" Time = "); Serial.print(now.hour(), DEC); Serial.print(':'); Serial.print(now.minute(), DEC); Serial.print(':'); Serial.print(now.second(), DEC); Serial.println(); delay(3000); if (now.hour() == 20 && now.minute() == 56 && now.second() < 10) digitalWrite(ledPin, HIGH); else { digitalWrite(ledPin, LOW); } }
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Online
Edison Member
Karma: 31
Posts: 1733
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #95 on: January 11, 2013, 05:58:44 am » |
You still need to take out "delay(3000);" , its not needed. Also now.second() < 10, is not for ANY 10 seconds, but for when the clock changes from say (example) 5 minutes to 6 minutes. The LED is only ON for the first 10 seconds, of the NEW minute. Actually it would be 7 seconds, since you have that 3 second delay still in there.
Just pointing that out.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
South Africa
Offline
Newbie
Karma: 0
Posts: 47
|
 |
« Reply #96 on: January 11, 2013, 06:05:26 am » |
Tx HazardsMind My objective with this was so that when i get my motor shield i will adapt the code to activate a dc motor at say 8am in and run it for ten seconds, then it will stop. Thant will be the time it takes from a closed blind to open them.
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Online
Edison Member
Karma: 31
Posts: 1733
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #97 on: January 11, 2013, 06:10:18 am » |
Ok, if it works,it works.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
|