From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Morse Code

Hello,

I am working on simple program, but realy i don't know how to do it. My DAQ NI-USB-6008 is connected to 2 buttons, i need to set one button as a dot and 2nd as underscore. The program will interpret the string as a word that will display on the monitor. If anyone knows how to do it quickly, or have finished project, i will grateful.

 

Best regards

0 Kudos
Message 1 of 5
(6,240 Views)

I would probably have a producer consumer architecture where the producer just sends a 1 or 0 depending on what you pressed then the consumer translates that binary into morse code.  It doesn't seem too bad looking at a morse code tree, the community example below might give you some ideas.

 

https://decibel.ni.com/content/docs/DOC-17111

 

I'm sure there are much better and more thought out ideas though.

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 5
(6,221 Views)

Yes, i saw this solution but its too complex. I try to reduce but i failed. That's why i ask for done. I apologize for my laziness.

0 Kudos
Message 3 of 5
(6,208 Views)

The example is pretty hard to follow.  Undocumented string manipulation is a nightmare to read through.


If you post what you have so far we can take a look at it and give some pointers.  No need to apologize, you will just find on these forums that people are much more responsive if you post code of what you have tried.

Matt J | National Instruments | CLA
0 Kudos
Message 4 of 5
(6,200 Views)

You'll generally have better luck going to the MultifunctionDAQ forums for a MultifunctionDAQ device.

 

You'll rarely find anyone will write your program for you.  You're not paying them to do so.  You shouldn't expect it.   Show some effort and people will be glad to help.

 

The example may seem "more complex" to you, but it's really a simplified version of what you want.  You want to use two different buttons to do two different tasks.  This just uses the single button and measures two different periods of time.  You should be able to see how it's measuring the input.  If you duplicate this and use each of your buttons as an input, you should be able to quickly replicate the behavior.  From there, you can take advantage of the translator that is already in place to finish out your project. 

 

That example is as close to a finished project you should expect to be given.  It's not lazy to ask for more.  It's disrespectful.

0 Kudos
Message 5 of 5
(6,154 Views)