Pages: [1]   Go Down
Author Topic: Problems with analogWrite and RTC DS1307  (Read 280 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a code that uses a real time clock DS1307 and RGB LEDs. However, when I use the analogWrite function along with the rtc function such as:
Code:
DateTime now = RTC.now();
for{byte x = 0; x < 254; x++){
  analogWrite(rgbPWMpin, x);
}
The LED starts to glow, but then the whole Aduino freezes after a random amount of time. Why does this happen and is there any way to fix this?


Note: I am using the library and instructions for the DS1307 from the ladyada website: http://www.ladyada.net/learn/breakoutplus/ds1307rtc.html
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 638
Posts: 50331
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That code won't even compile. No setup(). No loop(). Snippets-r-us.com is down the internet a ways. Here, we get to see ALL the code.
Logged

Pages: [1]   Go Up
Jump to: