void setup() {
Serial.begin(9600); // Inicia comunicación serial
pinMode(8, OUTPUT); // Configura pin 8 como salida
digitalWrite(8, HIGH); // Enciende el LED
// Simulación de mediciones esperadas
float voltageTotal = 4.96; // Voltaje total desde el pin
float voltageLed = 1.85; // Caída de tensión en el LED
float voltageResistor = 3.11; // Caída de tensión en la resistencia
float resistorValue = 330.0; // Ohmios
float current = voltageResistor / resistorValue * 1000.0; // Corriente en mA
Serial.println("=== Medidas del circuito ===");
Serial.print("Voltaje total (pin 8 a GND): ");
Serial.print(voltageTotal);
Serial.println(" V");
Serial.print("Voltaje en el LED: ");
Serial.print(voltageLed);
Serial.println(" V");
Serial.print("Voltaje en la resistencia: ");
Serial.print(voltageResistor);
Serial.println(" V");
Serial.print("Corriente estimada (Ohm's Law): ");
Serial.print(current);
Serial.println(" mA");
}
void loop() {
// El LED permanece encendido
}