Getting Started

(lily) #1

Chapter 8: C Pointers and Arrays


fault:
sendFString(BAD_COMMAND1);

oid volumeUp()

OCRA1L = Volume;


}


void volumeDown()
{
if(Volume < 11)
Volume = 6;
else
Volume -= 50;


OCRA1H = 0;
OCRA1L = Volume;
}


void stopTune()
{
cbi(TCCR1B, 0); // stop Playing
TCCR1A =
TCCR1B = 0;
sbi(PORTB, 5); // set OC1A high


break;
case 'd':
if((s[1]=='e')&&(s[2]=='m')&&(s[3]=='o')&& (s[4 =='?'))
sendFString(TALKING_TO);
sendFString(WHO_DEMO);
break;
de


sendChar(s[0]);
sendFString(BAD_COMMAND2);
break;


}
s[0] = '\0';
}
}


v
{
if(Volume >= 250)
Volume = 250;
else
Volume += 50;


OCRA1H = 0;


0;
Free download pdf