The Number is then printed out to the serial port. If a matching code for a number is found, then the integer value is added to the value of the ASCII “A” minus a offset to produce the correct ASCII number.The Letter is then printed out to the serial port. If a matching code for a letter is found, then the integer value is added to the value of the ASCII “A”, which produces the correct ASCII letter.While looping an integer variable is incremented. The converter routine simply loops around until it finds the correct code.The Converter routine simply compares the compiled string against and array of strings which map to each of the 26 letters, or each of the 10 numbers.If the telegraph input remains low (inactive) for a further 300ms, then it’s assumed that the end of a letter has been reached.If the pulse length is between 200ms and 500ms, then it is treated as a dash.A single “.” is appended to a string which will be compared later. If the pulse length is between 50 and 200ms, then it is treated as a dot.If the pulse length is less than 50ms, then it’s ignored completely as noise.These two times are subtracted and the difference stored in another variable. If the Telegraph input is pulled low, then if the Telegraph was previously pressed, a second time is stored.A flag is then set to true, indicating that the telegraph has been pressed and is being timed. If the Telegraph Input on D0 in pulled high by the Nail Circuit, then, so long as the telegraph pulse isn’t already being timed, then the current time (millis()) is stored in a variable.The basic operation is as follows IoT Telegraph Flowchart It also didn’t have any decoding for numbers, so I fixed that up and I was good to go It needed some tidying up… It wasn’t working too well for the ESP8266, as it kept resetting the watchdog. I did some searching around and found a nice starting guide over on Instructables by Pinaki_91 Select ESP8266 COM Port The Basic Morse Decoding Software
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |