Ref. 105.LED10BAR/RO

10 SEGMENTOS BARRA LED ROJO 20PINS

Stock: 56  
Ref. 105.LED10BAR/RO
Precio (IVA incluido) 0,94 €
Envío Gratis a partir de 150 €
LED Bar Graph
Number of pins: 20
Number of LEDs: 10
Colors of bars: 10 Red
Every 2 pins controls one bar of the bar graph
Works with TS-459 Bar Graph LED Driver chip

sAMPLE CODE PARA ARDUINO
/*
10-bar LED array

Connect the LED array to pins 11-2 and through a 220R resistor to ground on the other side.
01/14/2010
*/

void setup ()
{
for (int loop = 2; loop {
pinMode (loop, OUTPUT); // Set the pin IO mode
digitalWrite (loop, LOW);
}
}

void loop ()
{
// The loop has to start at 2 because 1 isn't an IO pin.
// Go from right to left
for (int loop = 2; loop {
// Switch the LED on for 10 milliseconds
digitalWrite (loop, HIGH);
delay (10);
digitalWrite (loop, LOW);
delay (20);
}

// And from left to right again
for (int loop = 11; loop > 1; loop--)
{
digitalWrite (loop, HIGH);
delay (10);
digitalWrite (loop, LOW);
delay (20);
}
}

And the second one changes the loop to be:

void loop ()
{
// Start on LED 6 and go up to 10 (remember, shifted by 1)
for (int loop = 7; loop {
// Light the LED on the LHS of middle and the matching one on the RHS
// This will light LEDs 6-5, 7-4, 8-3, 9-2, 10-1 (shifted by 1)
digitalWrite (loop, HIGH);
digitalWrite (13 - loop, HIGH);
delay (10);
digitalWrite (loop, LOW);
digitalWrite (13 - loop, LOW);
delay (20);
}

// And back down to the middle again
for (int loop = 11; loop > 6; loop--)
{
digitalWrite (loop, HIGH);
digitalWrite (13 - loop, HIGH);
delay (10);
digitalWrite (loop, LOW);
digitalWrite (13 - loop, LOW);
delay (20);
}
}
Reciba las novedades en su email
  • Periféricos de Cabo Vilán S.L. - C.I.F.: ESB70364260
  • Sofía Rivas, 1 - 15123 - Camariñas - A Coruña - España.