Nibbles and Bits
The Care and Feeding of My Pet Arduino by Budd Churchward - WB7FHC - NIBBLES AND BITS LIBRARY
«1 2 3 4 5 6 7 8 9 10 11 12 13 15 16 17 18 19 » |
Section 11
OK, things are really coming together, now. Let's clean up this sketch. We have put in many lines just to help you see how this things work. I recommend that you copy the items marked in yellow and paste them in the correct places, first. Notice that one of them just changes the format that our number is printed from BIN (binary) to DEC (decimal).
We are also renaming our old printResults() proceedure. It is now called: shiftBits(). Make that change in two places that are highlighted in yellow.
We don't need to print out the leading zeros, so all of that goes.
Once you have made the three changes marked in yellow. Carefully delete all the code highlighted in orange. Finally compile the sketch to check for errors. Then run it as you have before. This time when you send characters in Morse Code, you will see a unique decimal number for each letter you send. |
|