Created
August 16, 2013 18:28
-
-
Save DenverDias/6252297 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void loop() | |
{ | |
while(!Serial.available()); | |
//This command makes it wait until the Serial data is sent | |
while(Serial.available()) | |
{ | |
Input[Index]=Serial.read(); | |
//Stores the byte of data from the serial buffer | |
Serial.print(Input[Index]); | |
//Prints out the same data | |
if(Input[Index]>=97&&Input[Index]<=122) | |
{ | |
Input[Index]=char(int(Input[Index])-32); | |
//Changes lowercase letters to uppercase | |
} | |
//This condition is used to uppercase all letters | |
} | |
//The loop runs until Serial data is completely transmitted | |
Serial.println(); | |
//Creates a new line | |
endofstring=Index; | |
//Stores the address of the last byte of data | |
for(Index=0;Index<=endofstring;Index++) | |
{ | |
playLetter(Input[Index]); | |
//Executes the playLetter function defined earlier | |
delay(letterSpace); | |
//Waits for 3 times unit duration between letters in words | |
} | |
Index=0; | |
//Sets index back to zero before the loop restarts | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment