Welcome to Cockpitbuilders.com. Please login or sign up.

May 08, 2024, 04:32:24 PM

Login with username, password and session length

PROUDLY ENDORSING


Fly Elise-ng
576 Guests, 0 Users
Members
Stats
  • Total Posts: 59,641
  • Total Topics: 7,853
  • Online today: 585
  • Online ever: 831
  • (May 03, 2024, 12:39:25 PM)
Users Online
Users: 0
Guests: 576
Total: 576

COUNTDOWN TO WF2022


WORLDFLIGHT TEAM USA

Will Depart in...

Recent

Welcome

6 FLightIllusion Radios for the price of 1/2 of a single FI radio

Started by RayS, October 22, 2015, 01:32:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RayS

I won't go into the WHY I started down this road (Suffice it to say all the FI radios are connected with a single ribbon cable, backwards. I added an Audio COntrol Panel by adding an in-line IDC connector the RIGHT way so I could add it to the chain. Queue funny burning electronics smell.....)

SO..........
I discovered that for 1/2 (ONE HALF!) the price of a SINGLE COMM/NAV radio from FlightIllusion, I can assemble 6 (SIX!) of these:


using a single arduino or teensy, (for all six)

One of these:


..plus a few switches, some smoked plexiglass and a dual rotary encoder.

Savings: Well over $1600 US.

The included Arduino LED library for the display makes it sooper-simple to program a COMM or NAV radio and send the values to X-Plane.

Parts... Ordered!




 
Ray Sotkiewicz

Bob Reed


RayS

Ray Sotkiewicz

Bob Reed


Joe Lavery

Ray I'd be interested to see the Arduino code for this, if you don't mind.

And I think you'll need another element to those displays for the radios.

Cheers
Joe.
Life isn't about waiting for the storm to pass, it's about learning to dance in the rain

Journalist - writer for  PC Pilot Magazine

Trevor Hale

I am guessing Ray you would just Hard Solder a #1 in front of those numbers?

Seems to be missing a digit LOL

Trev
Trevor Hale

Owner
http://www.cockpitbuilders.com

Director of Operations
Worldflight Team USA
http://www.worldflightusa.com

VATSIM:

RayS

I plan on just super-gluing a "+1" single digit to the left of each bar. I have several hundred of any color in the rainbow at my disposal so.. should be easy.

Joe, I worked on the  INC/DEC code last night for the lower 2 digits and got that working to correctly go from a .00 .02 .05 .07 .10 .12 (and reverse)

I should be putting in the rest of the code over the weekend. Pretty easy so far. :-)
Ray Sotkiewicz

jr2mey

James

RayS

Initial proof-of-concept coding is complete for the Arduino Radio stack.

Wasn't too bad... Only programmed myself into a few corners but nothing too tight. As long as I can keep the loop() as clear and clean as possible, I should be able to get the entire radio stack onto one Arduino, or Teensy, as is my final goal for this project.

Next step is to get this to send data to X-Plane.

(The LCD Panel is an interim solution until the 7-seg digits land on my doorstep.)

https://youtu.be/dQuoijSJ4eQ
Ray Sotkiewicz

Trevor Hale

Well you got me beat...  I wish I could do something like that.  Great job.
Trevor Hale

Owner
http://www.cockpitbuilders.com

Director of Operations
Worldflight Team USA
http://www.worldflightusa.com

VATSIM:

RayS

// The code so far: (Minus actually sending data to X-Plane...)
// Sending Data to X-Plane with Teensy:
// https://www.pjrc.com/teensy/td_flightsim.html


/* Encoder Library - TwoKnobs Example
* http://www.pjrc.com/teensy/td_libs_Encoder.html
*
* This example code is in the public domain.
*/

#include <Wire.h>  // Comes with Arduino IDE
#include <LiquidCrystal_I2C.h>

//#define ENCODER_OPTIMIZE_INTERRUPTS //Nope!

#define ARDUINO 256  //Who are we talking to?

#include <Encoder.h>

// Change these pin numbers to the pins connected to your encoder.
//   Best Performance: both pins have interrupt capability
//   Good Performance: only the first pin has interrupt capability
//   Low Performance:  neither pin has interrupt capability
Encoder knobLeft(30, 31);
Encoder knobRight(48, 49);

//Interim solution until LED Displays arrive
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

/*-----( Declare Variables )-----*/
// COM1 Variables. COM2 to be added
int StandbyLoDigit  = 0;
int StandbyHiDigit  = 118;
int ActiveLoDigit   = 0;
int ActiveHiDigit   = 118;
int _SwapLoDigit    = 0;
int _SwapHiDigit    = 0;

long positionLeft  = -999;
long positionRight = -999;
long newLeft, newRight;

const int btnSWAP         = 52; ACT/STBY XFER Button

int SWAP_STATE = 0;
int btnSWAPState = 0;

void setup()   /*----( SETUP: RUNS ONCE )----*/
{
  // SET UP IO PINS

  pinMode(btnSWAP, INPUT);
 

  //----------------------------------------------------
  // Interim Solution until LEDs Arrive
  //----------------------------------------------------
      Serial.begin(9600);  // Used to type in characters
      lcd.begin(20,4);   // initialize the lcd for 16 chars 2 lines, turn on backlight
      lcd.setCursor(2,1); //Start at character 4 on line 0
      lcd.print("Hello, Raymond!");
      delay(2000); 
      lcd.clear();
      lcd.setCursor(6,0); lcd.print("COM 1   COM 2");
      lcd.setCursor(0,2); lcd.print(" Act:");
      lcd.setCursor(0,3); lcd.print("Stby:");
      paintCOM1active();
      paintCOM1standby();
}/*--(end setup )---*/


void loop()   /*----( LOOP: RUNS CONSTANTLY )----*/
{
  btnSWAPState   = digitalRead(btnSWAP);
  newLeft        = knobLeft.read()/2;
  newRight       = knobRight.read()/2;
 
  if (newLeft > positionLeft)
  { 
    positionLeft = newLeft;
    StandbyLoDEC();
    paintCOM1standby();
     
  }
 
  if (newLeft < positionLeft)
  { 
    positionLeft = newLeft;
    StandbyLoINC();
    paintCOM1standby();
     
  }

   if (newRight > positionRight)
  { 
    positionRight = newRight;
    StandbyHiDEC();
    paintCOM1standby();
     
  }
 
  if (newRight < positionRight)
  { 
    positionRight = newRight;
    StandbyHiINC();
    paintCOM1standby();
     
  }
 
 
  // Get Button Status

  if(btnSWAPState == LOW)
  {
    Swap();
  }
  else
  {
    SWAP_STATE = 0; // Ensure SWAP routine only runs ONCE when button pressed   
  }
}/* --(end main loop )-- */

//------------------------------------------//
// Helper Routines
//------------------------------------------//

void Swap()
{
      if(SWAP_STATE == 0)
      {
      // Temporarily store Standby Freq
          _SwapLoDigit = StandbyLoDigit;
          _SwapHiDigit = StandbyHiDigit;
     
      // Set Standby Freq to current Active Freq
          StandbyLoDigit = ActiveLoDigit;
          StandbyHiDigit = ActiveHiDigit;
     
      // Set Active to Current Standby
          ActiveLoDigit = _SwapLoDigit;
          ActiveHiDigit = _SwapHiDigit;
      }

      SWAP_STATE = 1; // Ensure SWAP routine only runs ONCE when button pressed

      paintCOM1active();
      paintCOM1standby();
     
}

void StandbyLoINC()
{
        //-------------------------------//
        // Lower Digit INC
        //-------------------------------//
         if(StandbyLoDigit % 5 == 0)
          {
            StandbyLoDigit += 2;
          }
          else
          { 
            StandbyLoDigit += 3;
          }
               
          if(StandbyLoDigit > 97){StandbyLoDigit = 0;}
}       

void StandbyLoDEC()
{
        //-------------------------------//
        // Lower Digit DEC
        //-------------------------------//
         
          if(StandbyLoDigit % 5 == 0)
          {
            StandbyLoDigit -= 3;
          }
          else
          { 
            StandbyLoDigit -= 2;
          }
               
          if(StandbyLoDigit < 00){StandbyLoDigit = 97;}
}

void StandbyHiDEC()
{
        //-------------------------------//
        // High Digit DEC
        //-------------------------------//
            StandbyHiDigit -= 1;
               
          if(StandbyHiDigit < 118){StandbyHiDigit = 134;}
}

void StandbyHiINC()
{
        //-------------------------------//
        // High Digit DEC
        //-------------------------------//
            StandbyHiDigit += 1;
               
          if(StandbyHiDigit > 134){StandbyHiDigit = 118;}
}

void paintCOM1active()
{
    //------------------------------   
    // Paint Active Freq
    //------------------------------   
        lcd.setCursor(6,2); lcd.print(ActiveHiDigit);
        lcd.setCursor(9,2); lcd.print(".");
       
        if(ActiveLoDigit < 10)
        {
          lcd.setCursor(10,2); lcd.print(0); 
          lcd.setCursor(11,2); lcd.print(ActiveLoDigit);
        }
        else
        {
          lcd.setCursor(10,2); lcd.print(ActiveLoDigit); 
        }           
       
}

void paintCOM1standby()
{       
    //------------------------------   
    // Paint Standby Freq
    //------------------------------   
        lcd.setCursor(6,3); lcd.print(StandbyHiDigit);
        lcd.setCursor(9,3); lcd.print(".");
       
        if(StandbyLoDigit < 10)
        {
          lcd.setCursor(10,3); lcd.print(0); 
          lcd.setCursor(11,3); lcd.print(StandbyLoDigit);
        }
        else
        {
          lcd.setCursor(10,3); lcd.print(StandbyLoDigit); 
        }       
       
        //delay(2000);       
}
Ray Sotkiewicz

Like the Website ?
Support Cockpitbuilders.com and Click Below to Donate