Need help with void writing

Hello,

The following code has to make the LED blink "DANIEL" in morse code. It does not blink although there are no compilation errors. The regular sample program "Blink" works well, so the problem is not connections.

Am I missing anything?

Thank you

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

void writeD() { writeLine; writeDot; writeDot; }

void writeA() { writeDot; writeLine; }

void writeN() { writeLine; writeDot; }

void writeI() { writeDot; writeDot; }

void writeE() { writeDot; }

void writeL() { writeDot; writeLine; writeDot; writeDot; }

void writeDot() { int shortBlink=500; int longBlink=1000; digitalWrite(13,HIGH); delay(shortBlink); digitalWrite(13,LOW); delay(shortBlink); }

void writeLine() { int shortBlink=500; int longBlink=1000; digitalWrite(13,HIGH); delay(longBlink); digitalWrite(13,LOW); delay(shortBlink); }

void loop() {

writeD; writeA; writeN; writeI; writeE; writeL;

}

ronyyar: Am I missing anything?

You need to call those functions like this with ():

writeD();

.... not like this:

writeD;

edit... which is not to say there might not be other problems, but I didn't look more closely.

Thank you!

By the way, you haven't written any voids.

You have written some FUNCTIONS!

It does not blink although there are no compilation errors.

Really ?

michinyon: Really ?

Really - it compiles perfectly well - why shouldn't it?

void loop() {

writeD; writeA; writeN; writeI; writeE; writeL;

}

What does the compiler make of all of this ?

Are parentheses to invoke a function optional now ?

What does the compiler make of all of this ?

The same as it would make of

void setup ()
{}
void loop ()
{
  42;
}
  • it would be perfectly happy.

To invoke a function, they're not optional.

To test the existence of a function, and discard the result, they must be omitted.