CIRCUITO DE 7 SEGMENTOS
https://circuits.io
// DECLARACION DE SEGMENTOS
int sege = 13;
int segd = 12;
int segc = 11;
int segb = 10;
int sega = 9;
int segf = 8;
int segg = 7;
// the setup routine runs once when you press reset:
void setup() {
// inicializar los segmentos como SALIDA
pinMode(sege, OUTPUT);
pinMode(segd, OUTPUT);
pinMode(segc, OUTPUT);
pinMode(segb, OUTPUT);
pinMode(sega, OUTPUT);
pinMode(segf, OUTPUT);
pinMode(segg, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(segf, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(sege, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segg, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segb, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segc, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(sega, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segd, HIGH); // turn the LED on (HIGH is the voltage level
delay(80);
// C
digitalWrite(sega, LOW); // turn the LED off by making the voltage LOW
digitalWrite(segf, LOW); // turn the LED on (HIGH is the voltage level
digitalWrite(sege, LOW); // turn the LED on (HIGH is the voltage level
digitalWrite(segd, LOW);
delay(50); // wait for a second
digitalWrite(segf, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(sege, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segg, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segb, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segc, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(sega, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segd, HIGH); // turn the LED on (HIGH is the voltage level
delay(80);
// I
digitalWrite(segf, LOW); // turn the LED off by making the voltage LOW
digitalWrite(sege, LOW); // turn the LED on (HIGH is the voltage level
delay(80);
digitalWrite(segf, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(sege, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segg, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segb, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segc, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(sega, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segd, HIGH); // turn the LED on (HIGH is the voltage level
delay(80);
// A
digitalWrite(sege, LOW);
digitalWrite(segf, LOW);
digitalWrite(sega, LOW);
digitalWrite(segb, LOW);
digitalWrite(segc, LOW);
digitalWrite(segg, LOW);
delay(80);
digitalWrite(segf, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(sege, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segg, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segb, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segc, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(sega, HIGH); // turn the LED on (HIGH is the voltage level
digitalWrite(segd, HIGH); // turn the LED on (HIGH is the voltage level
delay(80);
digitalWrite(segf, LOW); // turn the LED off by making the voltage LOW
digitalWrite(sege, LOW); // turn the LED on (HIGH is the voltage level
digitalWrite(segd, LOW); // turn the LED on (HIGH is the voltage level
digitalWrite(segb, LOW);
digitalWrite(segc, LOW);
digitalWrite(sega, LOW);
delay(500); // wait for a second
}

No hay comentarios:
Publicar un comentario