ArduPlane: LED digital writes use LED_OFF and LED_ON

This commit is contained in:
Pat Hickey 2011-11-25 14:55:30 -08:00
parent d4e9ad650b
commit a6bf2d9cd6
3 changed files with 18 additions and 18 deletions

View File

@ -31,16 +31,16 @@ static void init_barometer(void)
mavlink_delay(20); mavlink_delay(20);
if(flashcount == 5) { if(flashcount == 5) {
digitalWrite(C_LED_PIN, LOW); digitalWrite(C_LED_PIN, LED_OFF);
digitalWrite(A_LED_PIN, HIGH); digitalWrite(A_LED_PIN, LED_ON);
digitalWrite(B_LED_PIN, LOW); digitalWrite(B_LED_PIN, LED_OFF);
} }
if(flashcount >= 10) { if(flashcount >= 10) {
flashcount = 0; flashcount = 0;
digitalWrite(C_LED_PIN, HIGH); digitalWrite(C_LED_PIN, LED_ON);
digitalWrite(A_LED_PIN, LOW); digitalWrite(A_LED_PIN, LED_OFF);
digitalWrite(B_LED_PIN, HIGH); digitalWrite(B_LED_PIN, LED_ON);
} }
flashcount++; flashcount++;
} }

View File

@ -233,7 +233,7 @@ static void init_ardupilot()
// //
#if CLI_ENABLED == ENABLED && CLI_SLIDER_ENABLED == ENABLED #if CLI_ENABLED == ENABLED && CLI_SLIDER_ENABLED == ENABLED
if (digitalRead(SLIDE_SWITCH_PIN) == 0) { if (digitalRead(SLIDE_SWITCH_PIN) == 0) {
digitalWrite(A_LED_PIN,HIGH); // turn on setup-mode LED digitalWrite(A_LED_PIN,LED_ON); // turn on setup-mode LED
Serial.printf_P(PSTR("\n" Serial.printf_P(PSTR("\n"
"Entering interactive setup mode...\n" "Entering interactive setup mode...\n"
"\n" "\n"
@ -474,9 +474,9 @@ static void startup_IMU_ground(void)
#endif // HIL_MODE_ATTITUDE #endif // HIL_MODE_ATTITUDE
digitalWrite(B_LED_PIN, HIGH); // Set LED B high to indicate IMU ready digitalWrite(B_LED_PIN, LED_ON); // Set LED B high to indicate IMU ready
digitalWrite(A_LED_PIN, LOW); digitalWrite(A_LED_PIN, LED_OFF);
digitalWrite(C_LED_PIN, LOW); digitalWrite(C_LED_PIN, LED_OFF);
} }
@ -486,23 +486,23 @@ static void update_GPS_light(void)
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
switch (g_gps->status()) { switch (g_gps->status()) {
case(2): case(2):
digitalWrite(C_LED_PIN, HIGH); //Turn LED C on when gps has valid fix. digitalWrite(C_LED_PIN, LED_ON); //Turn LED C on when gps has valid fix.
break; break;
case(1): case(1):
if (g_gps->valid_read == true){ if (g_gps->valid_read == true){
GPS_light = !GPS_light; // Toggle light on and off to indicate gps messages being received, but no GPS fix lock GPS_light = !GPS_light; // Toggle light on and off to indicate gps messages being received, but no GPS fix lock
if (GPS_light){ if (GPS_light){
digitalWrite(C_LED_PIN, LOW); digitalWrite(C_LED_PIN, LED_OFF);
} else { } else {
digitalWrite(C_LED_PIN, HIGH); digitalWrite(C_LED_PIN, LED_ON);
} }
g_gps->valid_read = false; g_gps->valid_read = false;
} }
break; break;
default: default:
digitalWrite(C_LED_PIN, LOW); digitalWrite(C_LED_PIN, LED_OFF);
break; break;
} }
} }

View File

@ -719,14 +719,14 @@ test_rawgps(uint8_t argc, const Menu::arg *argv)
while(1){ while(1){
if (Serial3.available()){ if (Serial3.available()){
digitalWrite(B_LED_PIN, HIGH); // Blink Yellow LED if we are sending data to GPS digitalWrite(B_LED_PIN, LED_ON); // Blink Yellow LED if we are sending data to GPS
Serial1.write(Serial3.read()); Serial1.write(Serial3.read());
digitalWrite(B_LED_PIN, LOW); digitalWrite(B_LED_PIN, LED_OFF);
} }
if (Serial1.available()){ if (Serial1.available()){
digitalWrite(C_LED_PIN, HIGH); // Blink Red LED if we are receiving data from GPS digitalWrite(C_LED_PIN, LED_ON); // Blink Red LED if we are receiving data from GPS
Serial3.write(Serial1.read()); Serial3.write(Serial1.read());
digitalWrite(C_LED_PIN, LOW); digitalWrite(C_LED_PIN, LED_OFF);
} }
if(Serial.available() > 0){ if(Serial.available() > 0){
return (0); return (0);