Error in http://arduino.cc/en/Hacking/LibraryTutorial

The ratio of dot length to dash length in Morse code is 1:3, not 1:4 as in this tutorial. (See any book on Morse code, or Wikipedia.), the interletter spacing is three dot lengths (750 ms in the example) and the interword space is 7 dot lengths.

SOS is a "prosign" (see Wikipedia article) so letter spaces are not needed but it might be better to have the correct interword delay (1750 ms in the example, of which 250 ms is the trailing space of the dot/dash).

The code change is trivial. Presently the code is:-

int pin = 13;

void setup()
{
  pinMode(pin, OUTPUT);
}

void loop()
{
  dot(); dot(); dot();
  dash(); dash(); dash();
  dot(); dot(); dot();
  delay(3000);
}

void dot()
{
  digitalWrite(pin, HIGH);
  delay(250);
  digitalWrite(pin, LOW);
  delay(250);
}

void dash()
{
  digitalWrite(pin, HIGH);
  delay(1000);
  digitalWrite(pin, LOW);
  delay(250);
}

For a simple change it should be:-

int pin = 13;

void setup()
{
  pinMode(pin, OUTPUT);
}

void loop()
{
  dot(); dot(); dot();
  dash(); dash(); dash();
  dot(); dot(); dot();
  delay([color=red]1500[/color]);
}

void dot()
{
  digitalWrite(pin, HIGH);
  delay(250);
  digitalWrite(pin, LOW);
  delay(250);
}

void dash()
{
  digitalWrite(pin, HIGH);
  delay([color=red]750[/color]);
  digitalWrite(pin, LOW);
  delay(250);
}

I should like to correct this, but do not know how to make corrections, nor how to contact the original author to ask his permission. Advice anyone?

Regards - James Bryant

Don’t hold your breath :slight_smile:

Also wouldn’t it be wonderful if someone could get rid of all the calls to delay().

…R

Hey James, just pop back if you would and "modify" your previous post, highlight in turn each of the sections that are actual "code" and use the "code" ([ # ]) button to mark them up as code, then save it. It will be much more readable and make more sense that way.

Correcting the Arduino tutorials - this is only one of them! Please don't hold your breath!

...

Looks much better now!

Sorry - code marker added (see above). James

The tutorial is on how to build a library, not how to build a Morse transmitter. As a result, it doesn't have to meet any quality standards for Morse code transmission. As Robin2 says, don't hold your breath.

I fully understand that people are busy and corrections may take time, but errors must be corrected.

The fact that there is an error suggests that care has not been taken and that there may be other errors.

If I were buying a clock case I would not buy one containing a movement that struck thirteen, no matter how beautiful it was. The thirteenth stroke does not just cast doubt upon itself, but upon all those that went before.*

  • Herbert A P "Misleading Cases" ISBN 041338540

There’s no ‘maybe’ about it. People copy a circuit, upload the sketch and it doesn’t work. So, thinking they have got something wrong they come to the forum. Only to be told that there is an error in the wiring diagram they followed perfectly.

Shift register tutorial is one specific example.

It seems that the people who manage the Arduino website take care not to participate in this section of it.

...R

If I were buying a clock case I would not buy one containing a movement that struck thirteen, no matter how beautiful it was.

If the purpose for the clock in the case was simply to show that yours would fit, would you still be having a conniption fit over the fact that the clock wasn’t keeping good time?

The purpose of the tutorial was not to build a Morse code transmitter and receiver (clock in pretty case). It was to teach you how to create a library (the pretty case that the clock came in). If you don’t like the resulting library, it is now your library. Fix it. Or throw the stupid clock away and use your own in the pretty case.

dannable: Shift register tutorial is one specific example.

Oh yes, that one! :astonished:

(No :smoke-from-ears: icon found.)

If the person who made the pretty case did not take care with the works, what else, that I may have overlooked, have they not taken care of?

JamesBryant: If the person who made the pretty case did not take care with the works, what else, that I may have overlooked, have they not taken care of?

The pretty case was free. Get over it.

It's the price you pay for open source software. Maybe the Microsoft equivalent is better ???

I guess if the examples were hosted in a Wiki system you could correct it yourself. But that might create as many problems as it solves.

Other open source software projects have formal bug reporting systems and TODO lists but I haven't seen any for the Arduino system. Things may not get fixed any quicker but at least there is the illusion that someone cares.

...R

I got over it long ago.

All my posts after the first were responses to the suggestion that accuracy does not matter.

IMHO in engineering it is critically important.

All my posts after the first were responses to the suggestion that accuracy does not matter.

Of course accuracy matters. And, the tutorial ACCURATELY described how to build a library.

That the resulting library didn't meet your needs is no reflection on the accuracy of the tutorial on how to build a library.