element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
NexGen Flight Simuator NexGen: Fuel Load Indicator: Architecture
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: phoenixcomm
  • Date Created: 14 Oct 2020 10:53 PM Date Created
  • Views 881 views
  • Likes 5 likes
  • Comments 1 comment
  • flight simulator
  • nexgen
  • diy hardware
  • c
  • arduino mega 2560
  • arduino-ide
  • can interface
  • diy aircraft cockpit
  • eclipse ide
  • interrupts
  • recycleretrofitch
  • canaerospace
  • diy software
Related
Recommended

NexGen: Fuel Load Indicator: Architecture

phoenixcomm
phoenixcomm
14 Oct 2020

imageAs this node will be fairly busy, I have decided to implement this with interrupts.  The interrupts come from one of three (3) devices: CANaerospace Bus interface, USB term, one (1) of 2 switches, each with two(2) positions.image

 

CANaerospace Bus:

Hardware - Software Design:
  1. On of two switches, each with two positions.
  2. CANaerospace Bus
  3. TTY1(USB)
This node can respond to messages for ID#:
  • 0 IDS
  • 668-675: Fuel Tank in Quantity (US GAL)
  • 676-683: Fuel Tank Temperature (F)
  • 1301: Total fuel on board weight

 

Switches: To handle the 4 choices set P -Down and TEST - FILL. I will use a 7 to BCD priority encoder coupled to a Schmitt Trigger. I will use the following functions:

  1. void upTank up()
  2. void downTank down()
  3. void test() ::= Turns on all bits in both displays, waits about 30sec and then print(display) display1: BITE TEST,  display2 OK vxx
  4. fill( int curTank)::= Diplay1 curTank; Diplay2 Filled when fuel in curTank == #maxTank 75.0; etc.

 

Code Fragment:

int curTank =0;
i nt maxTank = 7;
void setup() {
pinMode( term, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(term), , CHANGE);
pinMode( switches, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(switches), switch, CHANGE);
pinMode( canbusInt, INPUT_PULLUP);}
attachInterrupt(digitalPinToInterrupt(intCanbus), canbus, CHANGE);

void loop(){
}

void switches() {
         switch() {
         case: 1 {
             upTank();
             break(); }
       case: 2 {
          Tank();
          break(); }
      case: 3 {
           fillTank();
           break(); }
       case: 4 {
             selfTest();
            break(); }
       default: ERROR
        }

void canbus() {
  if((canID=> 668) &&(caID <= 675)) { tank( canID, Quan); } // This is in  US GAL
   else if canD=> 676) &&(caID <= 683 ) { tank( canID, Temp); } // This is in F°
else{
switch( canID){
       case: 0 {
            node0(); { do something
             break;}
       case: 1301
            node1301(){ do something
             break;}
       default: { } // message not for this node
return ( FALSE ); } // #define FALSE 0

 

Reference:  CANaerospace Interface Specification; The default Node Identification Service (IDS) distribution are described in chapter V pages: 24/45

 

"Each CANaerpace unit must support at least the Identificacion Service (IDS) on Node Service Channel 0. This makes sure that a CANaerospace network can be scanned for attached units to determine their status, header type and identifier assignment. Note that within a CANaerospace network, other header types than the standard CANaerospace header and several identifier assignment schemes (including entirely user-defined ones) are supported. Whenever possible, it is strongly recommended to use the proposed standard header and identifier assignments, however." -- page: 11 par 2

  • Sign in to reply

Top Comments

  • DAB
    DAB over 4 years ago +1
    Nice update Chris. DAB
Parents
  • DAB
    DAB over 4 years ago

    Nice update Chris.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • DAB
    DAB over 4 years ago

    Nice update Chris.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube