Results 1 to 3 of 3
  1. #1
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Oct 2014
    Location
    Las Vegas, Nv.
    Posts
    8
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Displaying VOR1 flag

    I candisplay the VOR1 flag (=y) on my 16x2 display with arduino mega as 0, 1, 2 but I would like to convert that to off, to, From respectively. Thanks in advance. Also find inclosed code I've tried but did not work.

    case 'y': // Found the reading "AP VOR! Flag"
    flg1 = "";
    flg1 += getChar();
    if (flg1 != flg1old && digitalRead(24) == LOW) {
    lcd.setCursor(13, 0 );
    int(flg1) = flg;
    if(flg = 0) {
    lcd.print("Off ");
    }
    if(flg = 1) {
    lcd.print("To ");
    }
    if(flg = 2) {
    lcd.print("Frm");
    }
    // lcd.print(flg);
    flg1old = flg1;
    }
    break;
    }
    Attached Files Attached Files

  2. #2
    150+ Forum Groupie
    Join Date
    Nov 2013
    Location
    Evansville, Indiana
    Posts
    243
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Displaying VOR1 flag

    Try this.

    Code:
    case  'y': //  Found the reading "AP VOR! Flag"
            flg1 = "";
            flg1 += getChar();
            if (flg1 != flg1old && digitalRead(24) == LOW) {
            lcd.setCursor(13, 0 );
            flg = flg1.toInt();       // this is one way to do it
                              // Dont for get == means
                              // is equal to...
            if(flg == 0)      // You could also use flg1 here as
            {                 // if(flg1 == "0")
                lcd.print("Off");
            }
            if(flg == 1) 
            {
                lcd.print("To");
            }
            if(flg == 2)
            {
                lcd.print("Frm");
            }
            flg1old = flg1;
            
        break;

    ~Fess
    I will only ever be, half the Geek that I wished I was.
    TheGeekForge.Com

  3. #3
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Oct 2014
    Location
    Las Vegas, Nv.
    Posts
    8
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Displaying VOR1 flag

    Thanks Fess, your two for two with help to me. Fantastic solution that works great.