johnny78
Full Member level 5
hi Guys
one of the first lessons i've learned when started to learn programming was Numbers
but i forgot how to do this.
00010000
or
00000000
result
00010000
is it right i should use Or function ?
i've tried this with serial monitor to test what im doing but the result isnt what i need
help me with this please
sorry for my english maybe i couldnt explain what i need exactly or do a useful search
thanks
Johnny
one of the first lessons i've learned when started to learn programming was Numbers
but i forgot how to do this.
00010000
or
00000000
result
00010000
is it right i should use Or function ?
i've tried this with serial monitor to test what im doing but the result isnt what i need
Code:
int LedsDisplay = B00000000;
int PowerDisplay = B00010000;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("Start");
Serial.println(LedsDisplay);
delay(1000);
Serial.println(PowerDisplay);
delay(1000);
LedsDisplay = ((LedsDisplay) || (PowerDisplay));
Serial.println(LedsDisplay),BIN);
delay(1000);
int LedsDisplay = B00000000;
int PowerDisplay = B00010000;
delay(1000);
}
sorry for my english maybe i couldnt explain what i need exactly or do a useful search
thanks
Johnny
Last edited: