Greetings...In the attached sketch, my loop only runs once and stops...There are no errors compiling...I'm at a loss...Can anyone help?
Thanks in advance...Jim (NOT a programmer)
Arduino Uno Loop Question
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Jmarco1955
- Posts: 12
- Joined: Sun May 31, 2015 11:19 am
Arduino Uno Loop Question
- Attachments
-
[The extension ino has been deactivated and can no longer be displayed.]
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Arduino Uno Loop Question
Does i complete all 14 tracks?
- Jmarco1955
- Posts: 12
- Joined: Sun May 31, 2015 11:19 am
Re: Arduino Uno Loop Question
Yes Bill...After it plays track 14 the "rainbow" stops and the loop dies...
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Arduino Uno Loop Question
The only thing I see that would cause it to stop is if it failed to play one of the files. Your code is designed to hang in a tight loop if any of the tracks fails to start.
What happens if you comment out all of the while(1); statements?
What happens if you comment out all of the while(1); statements?
- Jmarco1955
- Posts: 12
- Joined: Sun May 31, 2015 11:19 am
Re: Arduino Uno Loop Question
That did it Bill!...I commented out the while (1) statements and it runs great now...
I need to study the example I copied that from...They seemed to be necessary but obviously not...
67 years old...Having fun learning and exploring via Adafruit...Thanks again...Jim
I need to study the example I copied that from...They seemed to be necessary but obviously not...
67 years old...Having fun learning and exploring via Adafruit...Thanks again...Jim
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Arduino Uno Loop Question
I see that a lot in code for some reason. It is almost never desirable for a program to simply hang without notification at the slightest sign of a problem.
Please be positive and constructive with your questions and comments.