// Arduino C++ Code - Throttle Status Indicator const int THROTTLE_PIN = 2; // Analog input pin connected to throttle potentiometer const int LED_PIN = 3; // Digital output pin connected to LED const int THRESHOLD = 3276; // 80% of 12-bit ADC (4095 * 0.8) void setup() { Serial.begin(115200); pinMode(LED_PIN, OUTPUT); analogReadResolution(12); // Configure ADC to 12-bit resolution } void loop() { int throttleValue = analogRead(THROTTLE_PIN); float percentage = (throttleValue / 4095.0) * 100.0; Serial.print("Throttle: "); Serial.print(percentage); Serial.println("%"); if (throttleValue > THRESHOLD) { digitalWrite(LED_PIN, HIGH); // Alarm LED ON } else { digitalWrite(LED_PIN, LOW); // Alarm LED OFF } delay(100); }