Here is the simplest version of a keyer program. Doing nothing but sense the dot contact closure of the paddle, and send the same signal out to a TX key line.
Nice accessory for the next Straight Key Night?
Ham Radio Blog
It seemed that my board has recovered by downloading a short test program right after the reset. There was a short window of time in which the board is recognized as a USB device, so perhaps my last program downloaded was doing something bad.
I did not have lines 1, 11, and 13 in the program, but if there is no INT signal applied to the CPU, nothing should go wrong, I suppose.
When I am extremely or exceptionally unbuy, I start watching a blue-ray disk for some operas.
To tell you the truth, however, I have never completed watching an opera until the very end. Today I aborted after around 90 min, although the run time of the video is 182 min.
http://www.youtube.com/watch?v=fas6zUDa5t8
Usually you need either a pull-up or a pull-down resistors for you input pins. With my old K3NG CW Keyer I forgot the details and thought I put some resistors on the board. But actually, the internal pull-up resistors were used for which some care is necessary for your code like:
pinMode(pin, INPUT); // set pin to input digitalWrite(pin, HIGH); // turn on pullup resistors
Or more simply,
pinMode(pin, INPUT_PULLUP);
Anyway, a single touch to the paddle causes several interrupts since there is no circuit implemented on the board to take care of the contact bounce.
It is always nice to have the source code with you.
K3NG kindly announces that It’s open source code so you can fully customize it to fit your needs and also perhaps learn from it or find coding ideas for other projects.
So here comes my learning process…
% wc k3ng_keyer.ino 9911 28900 339911 k3ng_keyer.ino
But the main program, k3ng_keyer.ino, has almost 10k lines, so you may hesitate to dive into the code.
If you comment out all the #define FEATURE_SOMETHING lines, and run the gcc preprocessor only (use -E option) to delete the #ifdef #endif stuff, there remains only 2268 lines, and the main part of the program looks like:
Now, you are tempted to use the source!
Some parts which I found to be interesting are:
http://en.wikipedia.org/wiki/Quantum_harmonic_oscillator
Once you noticed the relationship:
the problems with the perturbations proportional to either x^2 or x^4 are also easy to solve.
By applying the operator x to the state n, you will have the states n+1 and n-1. Therefore, if the operator is x^2, what you will have are the states n+2, n, and n-2.
I will leave it to you what you will get with the operator x^4, and compute the first and the second order energy shift for each case of the perturbations.
http://en.wikipedia.org/wiki/Macbeth
So perhaps something very easy for one is very difficult for others, and vice versa.
http://en.wikipedia.org/wiki/Perturbation_theory_(quantum_mechanics)
The equation itself should not be difficult to understand even for undergraduate students, but it took me several hours to solve a simple example such as:
The problem is a harmonic oscillator (the first and second terms of the right-hand side) with a perturbation proportional to x (the third term).
If you only notice that the operator x can be replaced by the lowering and raising operators, you will immediately get:
This is because there are only two non-zero terms in the summation (the third term of the right-hand side of the first equation). Although k goes from 0 to infinity, non-zero terms appear only when k=n-1 and k=n+1.