Arduino "freezes"

Hi! I am currently working on a box that has 30 LEDs on it. The problem with it is, that after 33 seconds of running (the LEDs are connected 10, 10, 10 on 3 separate pins for enough current flow) this part freezes. There is a photoresistor added, that makes another LED flash, which works after these 33 seconds have elapsed. Resetting the Arduino, restarting unplug and plugging back in only fixes for another 33 seconds.

Thanks for Your help in advance!

P.s. this is an sos project, so please help me if you can!

Dani

DaniFoldi:
Hi! I am currently working on a box that has 30 LEDs on it. The problem with it is, that after 33 seconds of running (the LEDs are connected 10, 10, 10 on 3 separate pins for enough current flow) this part freezes. There is a photoresistor added, that makes another LED flash, which works after these 33 seconds have elapsed. Resetting the Arduino, restarting unplug and plugging back in only fixes for another 33 seconds.

Thanks for Your help in advance!

P.s. this is an sos project, so please help me if you can!

Dani

I see the problem. On line ___ you are doing ##### when you should be doing *****. I'm sure it's an easy fix.

My crystal ball says that the problem is on line 42 of the code that you did not show us.

To post code and/or error messages:

  1. Use CTRL-T in the Arduino IDE to autoformat your code.
  2. Paste the autoformatted code between code tags (the </> button)
    so that we can easily see and deal with your code.
  3. Paste the complete error message between code tags (the </> button)
    so that we can easily see and deal with your messages.

Before posting again, you should read the three locked topics at the top of the Programming Questions forum, and any links to which these posts point.

If your project involves wiring, please provide a schematic and/or a wiring diagram and/or a photograph of the wiring.

Good Luck!

The problem with it is, that after 33 seconds

I'm going to take a guess here and say it's not 33 seconds, it's after 32.767 seconds.
Big hint.

If it's that long, I can't see why it's so urgent.

My tarot cards say that your code includes something like:

int time = millis();

Oh, and by the way, 32.767 × 1000 + 1= 215, maybe that rings a bell ...
If it doesn't, consider reading the millis() and int reference pages.

@DaniFoldi

The reason some of our members are having a bit of fun is that the forum has a few rules (strong suggestions) in the "stickies" at the beginning of every forum. Really simple stuff like providing us your code and a schematic (hand drawn & scanned) or a link. Sometimes, an uploaded pix is valuable. All in the spirit of you helping us to help you.

Resetting the Arduino, restarting unplug and plugging back in only fixes for another 33 seconds.

There is a "resetable" poly-fuse on the Arduino to protect from too much current being drawn. My guess: You are pulling too much current from the Arduino 5V onboard power regulator.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom... :slight_smile:

AWOL:
I'm going to take a guess here and say it's not 33 seconds, it's after 32.767 seconds.
Big hint.

If it's that long, I can't see why it's so urgent.

Exactly. You are using an integer in your loop to count milliseconds and you should be using a long. ?

6v6gt:
Exactly. You are using an integer in your loop to count milliseconds and you should be using a long. ?

unsigned long