I must program a compression of a 13-bit code to an 8-bit code for an Arduino board, I declared ports 52 to 28 as inputs, and outputs 53 to 39, but when programming the only port of entry that works well is 53.
For example, I declared an array with the input ports and used the first entrada[0]
and if the value is 1 active the output salida[0]
and turn on them, but if I change to entrada[1]
and leave the same output no longer works, but if I leave the same input and change the outputs the program works correctly.
int ledpin=47;
int inpin=52;
void setup() {
pinMode(ledpin, OUTPUT);
pinMode(inpin, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(inpin)==HIGH){
digitalWrite(ledpin, HIGH);
delay(1000);
digitalWrite(ledpin, LOW);
delay(1000);
}
else{
digitalWrite(ledpin, LOW);
}
}
So, the code does exactly what I want, but if for example inpin
change it from port 52 to 50 it takes me directly as if the input was high and when I move the switch it does not do anything.