Need help

Getting the error message "variable or field 'myFunction' declared void" How do i fix this?

void setup() 
{.
  pinMode(11, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(9, OUTPUT);

}

void loop() 
{
  myFunction(11, 10);
}

void myFunction(firstLed, secondLed)
  {
    digitalWrite(firstLed, HIGH);
    digitalWrite(secondLed, HIGH);
    delay(1000);
    digitalWrite(firstLed, LOW);
    digitalWrite(secondLed,LOW);
    delay(1000);
  }

What is this? {.

What type did you assign the two arguments in myFunction?

Two problems:

First, there appears to be a period after the opening brace of setup(). Second, the arguments to a function must have their data type specifiers explicitly stated:

// void myFunction(firstLed, secondLed)           // Incorrect format.

void myFunction(int firstLed, int secondLed)      // Note type specifiers
{
//  your code...

Yes, everybody who opens a tread needs help. That's not a very useful title is it? Please edit your start post and change the title to something useful.

But the problem is you did not specify the type of variable you expect in myFunction. You have o specify it. Because you use it to select pins a byte would do.

void myFunction(byte firstLed, byte secondLed)

And what is that point doing after the { on line 3?

The setting my arguments to int is what I forgot so thanks peeps :) I don't know how the {. got there lol but it didn't seem to affect anything

cblearnweb: The setting my arguments to int is what I forgot so thanks peeps :)

Read my post? byte is already big enough ;)

cblearnweb: I don't know how the {. got there lol but it didn't seem to affect anything

Ow yes it does, with the . there it will not compile at all...

septillion: Read my post? byte is already big enough ;)

Ow yes it does, with the . there it will not compile at all...

That's not quite what i meant but thanks for the help :)

I'm new to C# More of a javascript guy :o >:( :confused:

cblearnweb: I'm new to C#

This is C++

aarg: This is C++

Always thought it was a mix, learn something new everyday I guess.