
void getPhoneNumber()
{
int i
= 0;
int touchNumber;
Serial.println("Please
Enter
a
phone
number...");
while(i<PHONE_DIGITS)
{
while(checkInterrupt())
;
touchNumber
= 0;
touchstatus
= mpr121Read(0x01)
<< 8;
touchstatus
|= mpr121Read(0x00);
for (int j=0;
j<12;
j++)
//
Check
how
many
electrodes
wer
e
pressed
{
if ((touchstatus
& (1<<j)))
touc+;
}
if (touchNumber
== 1)
{
if (touchstatus
& (1<<STAR))
phoneNumber[i]
= '*';
else if (touchstatus
& (1<<SEVEN))
phoneNumber[i]
= '7';
else if (touchstatus
& (1<<FOUR))
phoneNumber[i]
= '4';
else if (touchstatus
& (1<<ONE))
phoneNumber[i]
= '1';
else if (touchstatus
& (1<<ZERO))
phoneNumber[i]
= '0';
else if (touchstatus
& (1<<EIGHT))
phoneNumber[i]
= '8';
else if (touchstatus
& (1<<FIVE))
phoneNumber[i]
= '5';
else if (touchstatus
& (1<<TWO))
phoneNumber[i]
= '2';
else if (touchstatus
& (1<<POUND))
phoneNumber[i]
= '#';
else if (touchstatus
& (1<<NINE))
phoneNumber[i]
= '9';
else if (touchstatus
& (1<<SIX))
phoneNumber[i]
= '6';
else if (touchstatus
& (1<<THREE))
Page 19 of 24