The attached program is a 'violin synthesiser', that uses 1 adc and 4 output pins (one for each 'string'.) The program cycles through each output to test for adc values that are only > 0 when a 'string' contacts a fret (ie a point along the resistor network in attached pic.) That adc value drives a calculation to find which eeprom address to look up, the lcd then displays the note value. It will eventually play the note via pwm rather than display it through lcd.
It works great for an indeterminate ammount of time, usually seconds, and then crashes, without any pattern to what behaviour preceded the crash.
I'm not sure the 'returns' and gotos' are the right way to control program flow here, I think they may be the cause of the crashes?
Apologies for not putting this small program into the body of the message; I havent worked out how to do that.
It works great for an indeterminate ammount of time, usually seconds, and then crashes, without any pattern to what behaviour preceded the crash.
I'm not sure the 'returns' and gotos' are the right way to control program flow here, I think they may be the cause of the crashes?
Apologies for not putting this small program into the body of the message; I havent worked out how to do that.
Attachments
-
3.1 KB Views: 4
-
51.1 KB Views: 7