Chapter 9 – Digital Meets Analog – ADC and DAC
sendFString(ERROR_NONINT);
sendChar(s[i]);
ar('\r');
0;
}
1];
MilliSec_init(count);
// Send the song title to the PC
sendChar('\r');
startWave(2);
{
sendCh
return
}
ctc[j] = '\0';
if(j>4)// must be < 256
{
sendFString(ERROR_NUMTOLARGE);
return 0;
}
else
{
set_ctc(atoi(ctc));
}
return 1;
}
void set_ctc(int count)
{
char ctc[1
sendString("Setting the Compare Timer Count to: ");
itoa(count,ctc,10);
sendString(ctc);
sendChar('\r');
}
void startWave(int wave)
{
sendFString(TEXT_SETTING);
sendFString(TEXT_WAVE_TBL[wave]);
pWave=(int*)pgm_read_word(&Waves[wave]); // looks too complicated..
}
void startSine()
{
startWave(0);
}
void startSquare()
{
startWave(1);
}
void startSawtooth()
{
}