Defining a variable inside IF statement [solved]

Hi,

Can someone please help me out here, I cant see what is wrong with this code...
When I set line 10 high the variable bang is never set to 1...?

Thanks.

int inn = 10;
int wire = 0;
static int bang = 0;

void setup()
{
 pinMode(inn, INPUT);
}

void loop()
{
 wire = digitalRead(inn);
 
 if (wire = 1)
 {
 bang == 1;
 }
 else 
 {
 bang == 0;
 }
 
 
}

You have your = and == back to front

JimboZA:
You have your = and == back to front

OK, please enlighten me....

I am not clear on the difference between = and ==

= means to make something equal to another, as in bang = 1;

== is for when you test, as in if (wire == 1) {.....

JimboZA:
= means to make something equal to another, as in bang = 1;

== is for when you test, as in if (wire == 1) {.....

Oh, I didnt know that !

THANKYOU, it works now!!