Well I sort of take back my last statement. The sound outputs, but the timing is a bit sluggish and the sound quality is bad. It pops and crackles during the time that it's playing a tone. It may have something to do with the way it's coded. The image on screen also flickers while the tone is played as well. What I'm going for is a motorcycle-like sound that increases in frequency up to a certain number and then resets the frequency (revsound) to a lower value and then it starts a similar loop below it. Is this too much for the Arduino to handle? I wouldn't think so but I still could use some help I guess... ![]()
Here's the code:
#include <TVout.h>
#include "LightCycle.h"
#include <stdio.h>
TVout TV;
void setup()
{
TV.begin(NTSC,127,97);
TV.bitmap(0,0,LightCycle);
int revsound = 100;
while (revsound < 300)
{
TV.tone(revsound,65);
delay(65);
revsound ++;
}
revsound = 75;
while (revsound < 275)
{
TV.tone(revsound,60);
delay(60);
revsound ++;
}
revsound = 50;
while (revsound < 250)
{
TV.tone(revsound,60);
delay(60);
revsound ++;
}
noTone;
}
void loop()
{
}