#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <math.h>
/*
Development Board :ESP32
Student : Maather Mohammed
Student ID : 202413275
*/
// LCD configuration (I2C address 0x27)
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() {
// Configure ESP32 I2C communication
Wire.begin(21,22);
// Initialize the LCD
lcd.init();
lcd.backlight();
// Save the benchmark starting time
unsigned long startTime = millis();
// Variable used for mathematical operations
volatile float result = 0;
// Execute the benchmark calculations
for (int i = 1; i <= 5000; i++) {
result += sqrt(i) * sin(i);
}
// Measure the elapsed execution time
unsigned long duration = millis() - startTime;
// Present the results on the LCD
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Maather Mohammed");
lcd.setCursor(0,1);
lcd.print("Time: ");
lcd.print(duration);
lcd.print(" ms");
}
void loop() {
// No continuous processing is required
}