i wanted to exercise rgb and push button but i stucked here getting error

int redLed = 2;
int greenLed = 3;
int blueLed = 4;
int pushButton1 = 6;
int pushButton2 = 5;
int counter = 0;
void setup() {
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
pinMode(blueLed, OUTPUT);
pinMode(pushButton1, INPUT_PULLUP);
pinMode(pushButton2, INPUT_PULLUP);
Serial.begin(9600);
}

void loop() {
if(digitalWrite(pushButton1)<=LOW)
{
counter--
}
if(digitalWrite(pushButton2)>=LOW)
{
counter++
}
}

Arduino: 1.6.7 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Users\comp\Desktop\ArduinoSketches\rgbLed\sketch_mar19a\sketch_mar19a.ino: In function 'void loop()':

sketch_mar19a:17: error: too few arguments to function 'void digitalWrite(uint8_t, uint8_t)'

if(digitalWrite(tipkalo1)=<LOW)

^

In file included from sketch\sketch_mar19a.ino.cpp:1:0:

C:\Users\comp\Desktop\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:126:6: note: declared here

void digitalWrite(uint8_t, uint8_t);

^

sketch_mar19a:17: error: expected primary-expression before '<' token

if(digitalWrite(tipkalo1)=<LOW)

^

sketch_mar19a:20: error: expected ';' before '}' token

}

^

sketch_mar19a:21: error: too few arguments to function 'void digitalWrite(uint8_t, uint8_t)'

if(digitalWrite(tipkalo2)=>LOW)

^

In file included from sketch\sketch_mar19a.ino.cpp:1:0:

C:\Users\comp\Desktop\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:126:6: note: declared here

void digitalWrite(uint8_t, uint8_t);

^

sketch_mar19a:21: error: expected primary-expression before '>' token

if(digitalWrite(tipkalo2)=>LOW)

^

sketch_mar19a:24: error: expected ';' before '}' token

}

^

exit status 1
too few arguments to function 'void digitalWrite(uint8_t, uint8_t)'

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

if(digitalWrite(tipkalo1)<=LOW)
{

LOW has the value zero.
If digitalRead returns a value below zero, I'd be very very worried.

Semicolons are free - you should use more of them.

int redLed = 2;
int greenLed = 3;
int blueLed = 4;
int pushButton1 = 6;
int pushButton2 = 5;
int counter = 0;
void setup() {
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
pinMode(blueLed, OUTPUT);
pinMode(pushButton1, INPUT_PULLUP);
pinMode(pushButton2, INPUT_PULLUP);
Serial.begin(9600);
}

void loop() {
if(digitalWrite(pushButton1)<=LOW)
{
counter--
}
if(digitalWrite(pushButton2)>=LOW)
{
counter++
}
}

Arduino: 1.6.7 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Users\comp\Desktop\ArduinoSketches\rgbLed\sketch_mar19a\sketch_mar19a.ino: In function 'void loop()':

sketch_mar19a:17: error: too few arguments to function 'void digitalWrite(uint8_t, uint8_t)'

if(digitalWrite(tipkalo1)=<LOW)

^

In file included from sketch\sketch_mar19a.ino.cpp:1:0:

C:\Users\comp\Desktop\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:126:6: note: declared here

void digitalWrite(uint8_t, uint8_t);

^

sketch_mar19a:17: error: expected primary-expression before '<' token

if(digitalWrite(tipkalo1)=<LOW)

^

sketch_mar19a:20: error: expected ';' before '}' token

}

^

sketch_mar19a:21: error: too few arguments to function 'void digitalWrite(uint8_t, uint8_t)'

if(digitalWrite(tipkalo2)=>LOW)

^

In file included from sketch\sketch_mar19a.ino.cpp:1:0:

C:\Users\comp\Desktop\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:126:6: note: declared here

void digitalWrite(uint8_t, uint8_t);

^

sketch_mar19a:21: error: expected primary-expression before '>' token

if(digitalWrite(tipkalo2)=>LOW)

^

sketch_mar19a:24: error: expected ';' before '}' token

}

^

exit status 1
too few arguments to function 'void digitalWrite(uint8_t, uint8_t)'

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

Why would you write to a push button? Did you perhaps mean digitalRead? :slight_smile: Also, how many states can a push button be in? Can it be less than low? Greater than low? Have you looked up the syntax for comparison statements like >= ? Also, one of the errors references a "tipkalo" which I don't see anywhere in the sketch. That means either you posted the wrong sketch, or an incomplete sketch.

Altogether, not a good start.

Cross-posting also not a good start.

DO NOT CROSS-POST, CROSS-POSTING WASTES TIME.

We have a special this week on semicolons.

Here, I've got a few spare for you to use ; ; ; ;

You have posted code without using code tags. This creates certain problems and obstacles for other forum members. The code tags make the code look

like this

when posting source code files. It makes it easier to read, and can be copied with a single mouse click.
If you have already posted without using code tags, open your message and select "modify" from the pull down menu labelled, "More", at the lower left corner of the message. Highlight your code by selecting it (it turns blue), and then click on the "</>" icon at the upper left hand corner. Click on the "Save" button. Code tags can also be inserted manually in the forum text using the [code] and [/code] metatags.

When you are finished that, please read this post:

How to use this forum - please read.

Missing code tags does not, in my experience, remove semicolons.

AWOL:
Missing code tags does not, in my experience, remove semicolons.

True, however, formatting with ctrl-T does reveal some improper program structure. You can see strange indentation if the braces are not properly closed, for example. Okay, it doesn't affect semicolons.

But you can just go on and on with this code. For example, it has no statements to change the LEDs in any way.

But the missing ones stick out like the proverbial sore thumb.

AWOL:
But the missing ones stick out like the proverbial sore thumb.

Not if you're a Pascal programmer.

If you're a Pascal programmer, you're not in Kansas anymore, Toto.

AWOL:
If you're a Pascal programmer, you're not in Kansas anymore, Toto.

I can C clearly now, the brain is gone...