Skip to content

Instantly share code, notes, and snippets.

@DenverDias
Created August 16, 2013 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DenverDias/6252297 to your computer and use it in GitHub Desktop.
Save DenverDias/6252297 to your computer and use it in GitHub Desktop.
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