Chapter 9 – Digital Meets Analog – ADC and DAC
case 'l':
if((s[1]=='i') && (s[2]=='g')&& (s[3]=='h') && (s[4 =='t'))
case
if( & (s[3] == 'p'))
(s[3] == 't'))
') && (s[4]=='?'))
the ADC demo.\r");
ing("\rYou sent: '");
);
n't understand.\r");
}
hen you turn on the Butterfly you should see the following on HyperTerminal:
o communicate.
o the ADC demo.
temperature in fahrenheit
ltage value
pe in:
void parseInput(char s[])
{
// parse first character
switch (s[0])
{
getLight();
break;
't':
(s[1] == 'e') && (s[2] == 'm')&
getTemperature();
break;
case 'v':
if((s[1] == 'o') && (s[2] == 'l')&&
getVolt();
break;
case 'd':
if((s[1]=='e') && (s[2]=='m') && (s[3]=='o
sendString("You are talking to
break;
default:
sendStr
sendChar(s[0]
sendString("' - I do
break;
}
s[0] = '\0';
Using ADC
W
PC_Comm.c ready t
You are talking t
Commands:
light - returns a light value
temp - returns the
returns a vo
volt -
Ty