for joseph

Dependencies:   mbed

Committer:
danilob
Date:
Sat Feb 14 23:25:59 2015 +0000
Revision:
0:d2fad68b715a
Child:
1:4c288e0254f3
it is the bomb!

Who changed what in which revision?

UserRevisionLine numberNew contents of line
danilob 0:d2fad68b715a 1
danilob 0:d2fad68b715a 2 #include "parameters.h"
danilob 0:d2fad68b715a 3 #include "intHandler.h"
danilob 0:d2fad68b715a 4 #include "queue.h"
danilob 0:d2fad68b715a 5
danilob 0:d2fad68b715a 6 Serial pc(USBTX, USBRX);
danilob 0:d2fad68b715a 7 Serial gsm(PTC17,PTC16);
danilob 0:d2fad68b715a 8
danilob 0:d2fad68b715a 9 //Prototype
danilob 0:d2fad68b715a 10 void initializeGSM();
danilob 0:d2fad68b715a 11
danilob 0:d2fad68b715a 12
danilob 0:d2fad68b715a 13 int main()
danilob 0:d2fad68b715a 14 {
danilob 0:d2fad68b715a 15 initializeGSM();
danilob 0:d2fad68b715a 16 return 0;
danilob 0:d2fad68b715a 17 }
danilob 0:d2fad68b715a 18
danilob 0:d2fad68b715a 19 bool compare(char* word)
danilob 0:d2fad68b715a 20 {
danilob 0:d2fad68b715a 21 pc.printf("comparing...\r\n");
danilob 0:d2fad68b715a 22 int i = 0;
danilob 0:d2fad68b715a 23 char letter;
danilob 0:d2fad68b715a 24 do
danilob 0:d2fad68b715a 25 {
danilob 0:d2fad68b715a 26 letter = buffer.pop();
danilob 0:d2fad68b715a 27 pc.printf("letter queue : %c \r\n",letter);
danilob 0:d2fad68b715a 28 pc.printf("letter string : %c \r\n",word[i]);
danilob 0:d2fad68b715a 29 if(buffer.pop()!= word[i])
danilob 0:d2fad68b715a 30 return false;
danilob 0:d2fad68b715a 31 i++;
danilob 0:d2fad68b715a 32 }while(buffer.peek()!= '\n');
danilob 0:d2fad68b715a 33 buffer.pop();
danilob 0:d2fad68b715a 34 return true;
danilob 0:d2fad68b715a 35 }
danilob 0:d2fad68b715a 36