void setup() {
// Start the serial communication
Serial.begin(9600);
// Wait for the serial monitor to open
while (!Serial) {
delay(100);
}
}
void loop() {
// Input the original text in English
String originalText = "ABD Rahim KASIMAN";
// Print the original text
Serial.print("Original: ");
Serial.println(originalText);
// Convert the text to lowercase and print each character
String lowercaseText = convertToLowercase(originalText);
// Print the lowercase text
Serial.print("Lowercase: ");
Serial.println(lowercaseText);
// Wait for a moment before repeating
delay(1000);
}
// Function to convert a string to lowercase and print each character
String convertToLowercase(String input) {
String output = "";
for (int i = 0; i < input.length(); i++) {
char lowercaseChar = toLowerCase(input[i]);
Serial.print(lowercaseChar);
output += lowercaseChar;
}
Serial.println(); // Print a newline after the lowercase text
return output;
}