im very new at this. my code keeps saying error..dont know what its telling me ?

codeArduino: 1.6.0 (Windows 8), Board: "Arduino Uno"

sketch_apr10a.ino: In function 'void loop()':
sketch_apr10a.ino:12:30: error: too few arguments to function 'void digitalWrite(uint8_t, uint8_t)'
In file included from sketch_apr10a.ino:1:0:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:126:6: note: declared here
void digitalWrite(uint8_t, uint8_t);
^
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

Post your code. Use code tags.

int switchState = 0;

void setup() {
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(2, INPUT);

}

void loop(){
switchState = digitalWrite(2);
if (switchState == LOW){

digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
}
else {
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);

delay(250);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(250);
}
}[code][code][/code][/code]

 switchState = digitalWrite(2);

I think this should be :

 switchState = digitalRead(2);

Good job on the code tags haha.

You have all your pinmodes set but what about the intergers?

And waski is correct it must be digitalread as you need to read the switch state

You have all your pinmodes set but what about the intergers?

int switchState = 0;

thanks :smiley: .the code seems to be ok now but this error is coming up now haha
Arduino: 1.6.0 (Windows 8), Board: "Arduino Uno"

Sketch uses 1,212 bytes (3%) of program storage space. Maximum is 32,256 bytes.

Global variables use 11 bytes (0%) of dynamic memory, leaving 2,037 bytes for local variables. Maximum is 2,048 bytes.

avrdude: ser_open(): can't open device "\.\COM1": The system cannot find the file specified.

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.


What board do you have? Is it connected to your PC ? Did you choose correct COM number from menu TOOLS -> PORT ? Did you choose correct board from menu TOOLS -> Board ?

it was the wrong COM for my PC haha :P.. thanks for your help