8+ two LED functions off one pin
hi everyone. check out build of 2 led module has 8+ functions off 1 arduino pin.
watch youtube video at: http://www.youtube.com/watch?v=8uzndvtic24&feature=share&list=uu0_hiu0q4bhnghtijcg4sdw
watch youtube video at: http://www.youtube.com/watch?v=8uzndvtic24&feature=share&list=uu0_hiu0q4bhnghtijcg4sdw
code: [select]
/* module_2_leds 17 may 2014 jds :)
make module:
1) 1" x 1.5" perf board
1) male 3 pin header
2) female 2 pin headers
1) 220 ohm reststor
1) 74ls04 ic or inverter ic 74ls02 etc.
2) leds
wireing module:
3 pin male header pins are:
signal, 5 volts, ground.
connect signal pin inverter input , 1 pin
of each 2 pin female headers.
connect inverter output other side of the
2 female 2 pin headers.
connect 5 volt male header ic pin 14 of 74ls04
connect ground male header ic pin 7 of 74ls04.
plug 2 leds 2 female 2 pin headers, one
cathode, , on anode, signal side.
that's it!
connect signal arduino pin 3 'in example'.
connect 5 volt pin arduino 5 volts
connect ground pin arduino ground.
load , run program.
*/
int i;
int j;
int signalpin = 3;
void setup() {
pinmode(signalpin,output);
serial.begin(9600);
}
void loop() {
serial.println();
serial.println("jds led module");
serial.println("by: jim steinbrecher");
serial.println("all off 1 arduino pin.");
serial.println();
digitalwrite(signalpin,high);
serial.println("one led on");
delay(5000);
digitalwrite(signalpin,low);
serial.println("other led on");
delay(5000);
serial.println("one led flashing");
digitalwrite(signalpin,high);
for (i = 1; < 25; i++)
{
pinmode(signalpin, input);
delay(100);
pinmode(signalpin, output);
digitalwrite(signalpin,high);
delay(100);
}
serial.println("other led flashing");
digitalwrite(signalpin, low);
for (i = 1; < 25; i++)
{
pinmode(signalpin, input);
delay(100);
pinmode(signalpin, output);
digitalwrite(signalpin, low);
delay(100);
}
serial.println("flashing leds");
for (i = 1; < 25; i++)
{
digitalwrite(signalpin,high);
delay(100);
digitalwrite(signalpin,low);
delay(100);
}
serial.println("both leds on");
for (i = 1; < 2500; i++)
{
digitalwrite(signalpin,high);
delay(1);
digitalwrite(signalpin,low);
delay(1);
}
pinmode(signalpin,input);
serial.println("both leds off");
delay(5000);
pinmode(signalpin,output);
serial.println("flashing leds pwm");
for (i = 1; < 10; i++)
{
for (j = 1; j < 255; j++)
{
analogwrite(signalpin, j);
delay(2);
}
for(j = 255; j > 0; j--)
{
analogwrite(signalpin, j);
delay(2);
}
}
}
Arduino Forum > Topics > Product Design > 8+ two LED functions off one pin
arduino
Comments
Post a Comment