Skip to content

Instantly share code, notes, and snippets.

@HectorTorres
Created May 15, 2017 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HectorTorres/790b7f22d586f097ef0aa1a3436bdc68 to your computer and use it in GitHub Desktop.
Save HectorTorres/790b7f22d586f097ef0aa1a3436bdc68 to your computer and use it in GitHub Desktop.
Contador 7segmentos
void setup()
{
DDRD=255; //Se declara todo el puerto como salida
}
void loop()
{
//Al puerto "D" le asignamos los valores obtenidos haciendo una pausa de 1segundo entre cada numero
PORTD=0x7E; //0
delay(1000);
PORTD=0x30; //1
delay(1000);
PORTD=0x6D; //2
delay(1000);
PORTD=0x79; //3
delay(1000);
PORTD=0x33; //4
delay(1000);
PORTD=0x5B; //5
delay(1000);
PORTD=0x5F; //6
delay(1000);
PORTD=0x70; //7
delay(1000);
PORTD=0x7F; //8
delay(1000);
PORTD=0x7B; //9
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment