void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
}
void toUpperCase(char *str) {
// Loop through each character in the string
for (int i = 0; str[i] != '\0'; i++) {
// If the character is lowercase, convert it to uppercase
if (str[i] >= 'a' && str[i] <= 'z') {
str[i] = str[i] - 32;
}
}
}
void loop() {
// put your main code here, to run repeatedly:
// Declare and initialize the character array with a null terminator
char greeting[] = "Hello, world!\0";
// Call the function to convert greeting to uppercase
toUpperCase(greeting);
// Print the modified greeting to the Serial monitor
Serial.println(greeting);
// Wait for a second before repeating the loop
delay(1000);
}