Go Down

Topic: Problems with analogWrite and RTC DS1307 (Read 664 times) previous topic - next topic


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: [Select]
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


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.
The art of getting good answers lies in asking good questions.

Go Up