Hi guys,
I'm a member of an amateur radio group and I'm working in conjunction with another club member on what's called a foxhunt transmitter. My friend is working on a small transmitter circuit while I am working on the logic side of things.
Basically I've got a circuit which uses an ATtiny85 to put the transmitter into transmit via an optical isolator and then the ATtiny, using PWM, plays a morse ident followed by some melodies before finishing off with the morse ident again.
The problem I'm having is that everything works great when I only call two of the melody functions. As soon as I call the third melody function into the loop the program goes mad and just plays the first morse ident followed by the first melody and then finally the last morse ident. It totally skips melodies two and three altogether and I can't for the life of me see why when each melody function is constructed identically.
One thing I should point out was that when building and compiling the third function and attempting to upload to the ATtiny, the arduino IDE threw a fit and generated a long error message which I googled and found the cure was to replace the ld.exe with a newer one (if that helps solve any of this).
Also I had issues at first with the ATtiny not generating tones so I googled around and found I needed a different core to the one I was using so the one I am now using sets the ATtiny to run at 8MHz internal with BOD disabled. Using this core cured the no tone issue.
Since this is only an early prototype the code isn't as optimised as it could be, there are a lot of repeats which I plan to iron out when I've got things working as I want.
Had to post code on pastebin due to character limitations on this board...
Any help would be greatly appreciated!!!!
Many thanks!