Hi everyone. We'll be going over the Morse Code Encoder.
So, the first thing you want to understand
about what to do about all these projects that we're going to
be going over is you want to see what the hardware requirements are.
So the first thing, the Sensors Mezzanine and two Grove connectors,
a touch sensor and a LED.
Obviously, you need the DragonBoard as well,
but we assume that you already have that.
So, you want to connect the touch sensor to the GPIO
G. We reference it using the letter because that's how you can see that on the Mezzanine,
and it's also referred to as "Pin 29" when you use LED MRAA.
So LED is GPIO E and Pin 27.
So you want to connect these.
So, if you guys don't know,
Morse Code is a method of converting the length of button presses
so it depends on how long you press the button to convert these into messages.
So, there are two main ways to distinguish the button press.
There's the dot, which is a short button press and then a dash,
which is a longer button press.
And then a combination of these signals will mean one letter.
So if you do certain combinations of dots and dashes,
this will be A or B or so forth.
And the conversion is provided in InternationalMorseCode.py.
And you guys can see what each dot and dash represent.
So, we'll teach you guys more about what is exactly our specifications.
So in this program,
we have it set so that the time required for a dot is
about point five to one point five seconds.
And the time required for a dash is two point five to three point five seconds.
Anything out of these ranges would be interpreted as
wrong input and the time
to process a letter is about two point five to four point five seconds.
So this is going to be the time that you wait between a press.
So after you finished the press,
you wait two point five to four point five seconds so
that letter can be processed when you press again.
And time required to process a word is greater than six point five seconds.
So after you finish typing a letter,
you wait and then you
press it up to six point five seconds and it should be interpreted as a word.
So now we'll be going to the terminal and show you guys how to execute this program.
So here we are at the Morse Code directory.
So let's just press LS to see what's in here.
And here's the InternationalMorseCode.py and this is basically
all the conversations from Morse Code to the letters that you know in the alphabet.
And then there's the README,
which can be found on the GitHub and this basically describes
everything you're going to do on the DragonBoard for this project.
And we're going to show you all of this as well.
And then the Transmitter.py and it's the program
itself that actually runs the Morse Code Encoder.
So, we're not going to go through InternationalMorseCode.py or the README,
but let's just try out the Transmitter.py.
So, another important note is to do sudo before you run
Transmitter.py and some permissions of Transmitter.py are not granted to you,
so you need to sudo before.
And then python, this is how you compile and run python files and
we can just do Transmitter.py and then here we are.
So I'll be doing a quick demo of what it looks like.
So first, I want to do the letter D. So that will be a dash and two dots.
Before we do the letter,
we can see here that this is the sensor we'll be using and this is the little LED.
The only purpose of the LED is provide us with a kind
of tempo of how much time is passing so that it's a little easier to understand.
So we'll just go back to showing you guys what's on the output when we press this.
So, if I hold this down for about four or five seconds,
on the terminal you'll see that,
I'll put kind of an error.
Yeah, unrecognized input, so it's about eight seconds, so it was way too long.
So if you put really quick, you get a dot.
Yeah, you get a dash. I did it on or off time.
But now let's try to empty that out and wait
a little bit so it interprets it as a letter and then we can get rid of that.
So it's been a good amount of time so let's just try to press it again,
and now we can see that it interpreted it as a T. So that's just the quick demo part.
Let's do something meaningful like DB.
So, as I said before,
it's a dash and two dots.
So we'll do about a second,
so about two and a half.
There we go. Oh it's way too long.
So try to use a metronome.
And, unrecognized.
It might take a little bit for you guys to get the hang of this. I know it did for us.
See, one to two, there we go.
And then the dot is pretty quick and then there we go.
So dots are much easier than dashes to get a hold of.
So let's wait a little bit to get the letter.
And then you get D. So we'll do another dash.
Actually, it recognizes it as a wrong input so a little longer this time.
And there we go, a dash and do another dot.
And B is actually three dots,
so it's not too much different from D coincidentally.
And then we'll empty that out into a B. There we go.
So now we have a DB for DragonBoard.
So you guys can play around with this and try to make
a whole sequence of letters and interpretations.
So on the next video we'll be going over how
the code actually works and breaking it down.
Yeah.