Morse decoder audio1/20/2024 Printf("\nMorse sound in progress.\n") įor (j = 0 alphamorse) - 65] != '\0' j++) // Counting the numbers of dash/dots in the wordĬode: /** Record input into an array Save array to a file Playback recorded Phil Burk Printf("%s ", alphamorse) - 65]) // Print the a-z string If (T != ' ' & (!isdigit(T))) // if user input isnt space or number While (T != '\0') // Convert the string to morse (the end of the string '\0') Printf("\nMorse convert in progress.\n") // UI Printf("\nYour input:\n") // UI -> string show Gets(T) // To recive input from user keyboard Printf("\nEnter a sentence:\n") // UI -> string Scanf_s("%d", &delaydd) // To recive input from user keyboard Printf("\n Delay between Dash/Dot duration : \n") // UI -> delay duration (Default 0msec) Scanf_s("%d", &dot) // To recive input from user keyboard Printf("\n Dot ('.') duration : \n") // UI -> dash duration (Default 100msec) Scanf_s("%d", &dash) // To recive input from user keyboard Printf("\n Dash ('-') duration : \n") // UI -> dash duration (Default 300msec) Gets(enter) //recive the 'Enter' pressing from user without interruption for the gets below Scanf_s("%d", &freq) // To recive input from user keyboard } while (input > 4 || input frequancy (Default -> unsigned int freq=550) Scanf_s("%d", &input) // scan -> user input Printf("\nUltrasonic Data Transmit & Receive - POC\n \nChoose one of the following options by entering the number:\n" "\n1.Transmit\n" "2.Receive\n" "3.Configuration\n" "4.Exit\n") //UI main menu Input = 0 count = 0 i = 0, j = 0 // reset the Setting & Variables values Unsigned int input = 0 //defult value of menu input Unsigned int delaydd = 0 // delay between dash/dots Unsigned int freq=550,dash=300,dot=100 // Recommended -> dash time x3 then dot -Setting & Variables-//Ĭhar enter // To recive enter input without interruption #include "delay.h" // To call delay.h function #include // To use more standard functions #include // To use standard input/output functions #include // To use output of the computer (speakers) Code: #define _CRT_SECURE_NO_WARNINGS // To ingore VisualStudio C language errors
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |