Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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