• EvaG23 commented on Bot1398's instructable Arduino Morse Code Flaher6 months ago
    Arduino Morse Code Flaher

    Here is my version (for situations when conservation of memory IS an issue). Transmits a stored message over and over again by simply flashing the built in LED on Arduino Nano or Digispark. I have used a struct to encode dash-dot sequence for each letter in a bit field and the number of symbols for each letter:struct mc { unsigned char dd; unsigned char len;};Using something like struct mc {unsigned int dd:6;unsigned int len:3;};performs the same, using exactly the same amount of memory (because we need 6+3=9 bits for each letter) and the produced code is even slightly longer.All Morse equivalent of all the letters are stored in an array const struct mc mrs[] = { // right to left bit encoded, 1=-; 0=. , only len rightmost bits valid... /* A = ".-" */ { 0b000010, 2}, /* B = "-..." */ { 0b000001, 4}, /* C = "-.-." */ { 0b000101, 4},...Here is the sketch file. Feel free to use it or comment.

    View Instructable »
  • EvaG23 followed Raspberry Pi, Bikes, Robots, Electronics and 10 others channel 6 months ago