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
Acoustics
  • Challenges & Projects
  • Project14
  • Acoustics
  • More
  • Cancel
Acoustics
Blog Nexgen: FAA Nav Aid Station Morse Code - Software
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Acoustics to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: phoenixcomm
  • Date Created: 5 Apr 2020 10:23 PM Date Created
  • Views 731 views
  • Likes 4 likes
  • Comments 2 comments
  • c
  • arduino mega 2560
  • sender
  • morse code
  • diy
  • p14acousticsch
  • can bus listener
  • acousticsch
  • nexgen flight simulator
Related
Recommended

Nexgen: FAA Nav Aid Station Morse Code - Software

phoenixcomm
phoenixcomm
5 Apr 2020

Ok, I have not been diligent in producing some software. Most of the algorithms that I have seen to do this job are rather slow. I have defined a MAX_LETTERS as a constant of 10 which will give me generous room for my ID Code. Since I like to modular my code I will need to write a function void sendTone( char 'letter' );image

BTW this device (Arduino) is a listener con the CAN bus.

 

MorseCode.hMorseCode.c

// morseCode d==dot D==Dash

//morseCode[value][string]

 

char morseCode[26][MAX_LETTERS] = {

"dD",   "Dddd", "DdDd", "Ddd,

"d",    "ddDd", "DDd",  "dddd",

"dd",   "dDDD", "DdD",  "dDdd",

"DD",   "Dd",   "DDD",  "dDDd",

"DDdD", "dDd",  "ddd",  "D",

"ddD",  "dddD", "dDD",  "DddD",

"DdDD", "DDdd"};

 

//units

const int TIME_UNIT = 250ms

const int DOT = TIME_UNIT;

const int DASH = 3 * TIME_UNIT;

const int C_SPACE = 2 * TIME_UNIT;

const int W_SPACE = 5 * TIME_UNIT;

const int LETTER_SPACE =

const int MAX_LETTERS = 10;

 

// Commands:

const int sendDot = 1;

const int sendDash = 2;

const int sendC_space = 3;

const int sendL_space = 4;

const int sendW_space = 5;

 

 

// pre-defines

getWord( char *name );

#include <stdio.h>

#include <stdlib.h>

#include <morseCode.h>

int main() {

getWord( char *name ){

    char letter;

    for( int count = 0; count <= MAX_LETTERS; count++)

        if( letter = name[count] != '\n') {

            int offset = 0x40 - letter;

            for(int v = 0; code = morseCode[offset][v] != '\n'; v++) {

                   If ( code  == 'D' || code == 'd' )  {  

                          sendMorse(  L, code ); }

                   elseif (code == {

                           sendMorse( S, code ); }

}              

 

return EXIT_SUCCESS;

}

Notes: the char array morseCode is an array of strings which are automatically terminated with a '\n'

void sendTone( char tone ) {

//  To be done later;

}

// please ignore the sendTone and sendSpace They have been replaced with a new function

int sendMorse( int command char*  Sound ) {

       switch ( command } {

            case sendDot: {

                   // generate Sound

                   break; }

            case sendDash: {

                   // generate Dot

                   break; }

            case sendC_space: {

                    // generate Sound

                   break; }

            case sendL_Sound: {

                   // generate Sound

                  break; }

            case sendW_space: {

                    // generate Sound

                   break; }

            defualt; { }}}

 

void sendSpace( int space ) {

// to be done later;

}

 

 

 

/

  • Sign in to reply

Top Comments

  • phoenixcomm
    phoenixcomm over 5 years ago in reply to cstanton +1
    cstanton All Navaid stations transmit their ID in Morse Code. Its kind of mandatory in a Nav System.
Parents
  • cstanton
    cstanton over 5 years ago

    What part does this play in the overall project?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • cstanton
    cstanton over 5 years ago

    What part does this play in the overall project?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • phoenixcomm
    phoenixcomm over 5 years ago in reply to cstanton

    cstanton All Navaid stations transmit their ID in Morse Code. Its kind of mandatory in a Nav System.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
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