void setup() {
// put your setup code here, to run once:
unsigned char x_var;
for(x_var=0;x_var<9;x_var++){
pinMode(x_var+2, OUTPUT);
}
}
unsigned char datos_UN[] = {0x3E, 0x54};
void write_7S_port(unsigned char dato){
unsigned char x_var;
for(x_var=0;x_var<7;x_var++){
if(((dato >> x_var) & 0x01) == 1){
digitalWrite(x_var + 2, HIGH);
}
else{
digitalWrite(x_var + 2, LOW);
}
}
}
void loop() {
// put your main code here, to run repeatedly:
//rutina de multiplexacion para dos displays de siete segmentos
write_7S_port(datos_UN[0]);
digitalWrite(10, HIGH);
delay(8);
digitalWrite(10, LOW);
write_7S_port(datos_UN[1]);
digitalWrite(9, HIGH);
delay(8);
digitalWrite(9, LOW);
}