Diferencia entre revisiones de «Arduino»
Ir a la navegación
Ir a la búsqueda
(Página creada con «== Enllaços == http://learn.adafruit.com/all-about-leds?view=all») |
Sin resumen de edición |
||
| Línea 1: | Línea 1: | ||
== Projectes == | |||
=== Comptador === | |||
Per a fer aquest comptador utlitzem un Display BCD i un xip '''cd4511be''' | |||
Si tenim en compte que el xip decodificador té aquestes entrades: | |||
[[Archivo:Cd4511 pin.jpg]] | |||
i el display aquestes: | |||
[[Archivo:Displaybcd.png]] | |||
Les connexions quedaran: | |||
{| | |||
|-Arduino | |||
|cd4511be | |||
|-2 | |||
|A | |||
|-3 | |||
|B | |||
|-4 | |||
|C | |||
|-5 | |||
|D | |||
|-5v | |||
|Vdd, LT, BL | |||
|-GND | |||
|VSS, LE | |||
|} | |||
<nowiki> | |||
void setup() | |||
{ | |||
for (int i=2;i<6;i++){ | |||
pinMode(i,OUTPUT); | |||
} | |||
} | |||
void loop() | |||
{ | |||
digitalWrite(2,0); | |||
digitalWrite(3,0); | |||
digitalWrite(4,0); | |||
digitalWrite(5,0); | |||
delay(1000); | |||
digitalWrite(2,1); | |||
digitalWrite(3,0); | |||
digitalWrite(4,0); | |||
digitalWrite(5,0); | |||
delay(1000); | |||
digitalWrite(2,0); | |||
digitalWrite(3,1); | |||
digitalWrite(4,0); | |||
digitalWrite(5,0); | |||
delay(1000); | |||
digitalWrite(2,1); | |||
digitalWrite(3,1); | |||
digitalWrite(4,0); | |||
digitalWrite(5,0); | |||
delay(1000); | |||
digitalWrite(2,0); | |||
digitalWrite(3,0); | |||
digitalWrite(4,1); | |||
digitalWrite(5,0); | |||
delay(1000); | |||
digitalWrite(2,1); | |||
digitalWrite(3,0); | |||
digitalWrite(4,1); | |||
digitalWrite(5,0); | |||
delay(1000); | |||
digitalWrite(2,0); | |||
digitalWrite(3,1); | |||
digitalWrite(4,1); | |||
digitalWrite(5,0); | |||
delay(1000); | |||
digitalWrite(2,1); | |||
digitalWrite(3,1); | |||
digitalWrite(4,1); | |||
digitalWrite(5,0); | |||
delay(1000); | |||
digitalWrite(2,0); | |||
digitalWrite(3,0); | |||
digitalWrite(4,0); | |||
digitalWrite(5,1); | |||
delay(1000); | |||
digitalWrite(2,1); | |||
digitalWrite(3,0); | |||
digitalWrite(4,0); | |||
digitalWrite(5,1); | |||
delay(1000); | |||
} | |||
</nowiki> | |||
== Enllaços == | == Enllaços == | ||
http://learn.adafruit.com/all-about-leds?view=all | http://learn.adafruit.com/all-about-leds?view=all | ||
http://www.sentex.ca/~mec1995/tutorial/7seg/7seg.html | |||
Revisión del 23:18 11 nov 2013
Projectes
Comptador
Per a fer aquest comptador utlitzem un Display BCD i un xip cd4511be
Si tenim en compte que el xip decodificador té aquestes entrades:
i el display aquestes:
Les connexions quedaran:
| cd4511be |
| A |
| B |
| C |
| D |
| Vdd, LT, BL |
| VSS, LE |
void setup()
{
for (int i=2;i<6;i++){
pinMode(i,OUTPUT);
}
}
void loop()
{
digitalWrite(2,0);
digitalWrite(3,0);
digitalWrite(4,0);
digitalWrite(5,0);
delay(1000);
digitalWrite(2,1);
digitalWrite(3,0);
digitalWrite(4,0);
digitalWrite(5,0);
delay(1000);
digitalWrite(2,0);
digitalWrite(3,1);
digitalWrite(4,0);
digitalWrite(5,0);
delay(1000);
digitalWrite(2,1);
digitalWrite(3,1);
digitalWrite(4,0);
digitalWrite(5,0);
delay(1000);
digitalWrite(2,0);
digitalWrite(3,0);
digitalWrite(4,1);
digitalWrite(5,0);
delay(1000);
digitalWrite(2,1);
digitalWrite(3,0);
digitalWrite(4,1);
digitalWrite(5,0);
delay(1000);
digitalWrite(2,0);
digitalWrite(3,1);
digitalWrite(4,1);
digitalWrite(5,0);
delay(1000);
digitalWrite(2,1);
digitalWrite(3,1);
digitalWrite(4,1);
digitalWrite(5,0);
delay(1000);
digitalWrite(2,0);
digitalWrite(3,0);
digitalWrite(4,0);
digitalWrite(5,1);
delay(1000);
digitalWrite(2,1);
digitalWrite(3,0);
digitalWrite(4,0);
digitalWrite(5,1);
delay(1000);
}
Enllaços
http://learn.adafruit.com/all-about-leds?view=all http://www.sentex.ca/~mec1995/tutorial/7seg/7seg.html

