Codeproblem if statement

Hi people,

I have a problem with this code

int PW;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);

}

void loop() {
PW=0;
// put your main code here, to run repeatedly:
if (PW =>0||<= 512)
{
Serial.println(PW);
}
}
Could somebody help me please?

I have a problem with this code

It would be a great help if you tell us the problem. What is it that the code does not do?

Read the how to use this forum-please read sticky to see how to properly post code and some advice on how to ask an effective question. Remove useless white space and format the code with the IDE autoformat tool (crtl-t or Tools, Auto Format) before posting code.

This

  if (PW =>0||<= 512)

is not how the condition of an “if” statement should look. I think that you meant

  if ((PW >=0)||(PW<= 512))

(I use extra parentheses just to be clear on my intent). I changed => to >= and I inserted another PW.

Please do some learning. Good Luck!

Since you set PW=0 immediately before the if statement it doesn’t seem to serve any purpose.

Particularly since every number in existence meets the conditions. Every positive number is >0 and every negative number is < 512. Perhaps you meant && (and) instead of || (or)?

Steve