Documente Academic
Documente Profesional
Documente Cultură
Contents
Introduction
Introduction to Blinky
Hardware Overview
Blinky features Components overview Schematic
Software Overview
Code Pseudo code
Introduction
Whenever we think of creating some patterns using LEDs many things come out of mind one such idea is set in mind to design a breakout using SMD LEDs. This breakout is artistic and it looks similar to bulb This breakout consists of eight SMD LEDs connected in series with SMD resistor. The LED array can be programmed by the data lines connected to LEDs that is extended through berg connectors. The breakout can be operated with normal 5 volts supply. The breakout can be screwed to fit into the surface by the holes provided on the breakout. This breakout finds applications artistically in the way user make use of.
Hardware Overview
Blinky features
Data lines are extended through berg connectors. Looks very artistic. The breakout can be screwed to surface. The breakout is designed with SMD LEDs and SMD resistor.
Components overview
Brief specification The voltage rating is 2 to 3.5 volts and current rating is 20ma 10 kohm
SMD resistor
Schematic
Software overview
Code
/* Blinky pattern1 Turns on Alternate LEDs on for one second, then off for one second, repeatedly. */ void setup() { // initialize the digital pin as an output. // Pin 13 has an LED connected on most Arduino boards: pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(7, OUTPUT); pinMode(8, OUTPUT); pinMode(9, OUTPUT); } void loop() { digitalWrite(2, HIGH); // set the LEDs on digitalWrite(4, HIGH); digitalWrite(6, HIGH); digitalWrite(8, HIGH); delay(1000); // wait for a second digitalWrite(3, LOW); // set the LED off digitalWrite(5, LOW); digitalWrite(7, LOW); digitalWrite(9, LOW); }
/* Blinky pattern2 Initially the odd LEDs is set to high and Brightness of Alternate LEDs gradually increases to maximum mean while the brightness of odd LEDs decreases, repeatedly. */ void setup() { // initialize the digital pin as an output. // Pin 13 has an LED connected on most Arduino boards: pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(7, OUTPUT); pinMode(8, OUTPUT); pinMode(9, OUTPUT);
} void loop() { Int PWMpin1 = 3; int PWMpin2 =6; int PWMpin3 = 9; PWMpin4 =11; digitalWrite(2, HIGH); //set the LEDs on digitalWrite(4, HIGH); digitalWrite(5, HIGH); digitalWrite(7, HIGH); For(int i=0; i<=255; i++) // brightness of the LEDs increases { analogWrite (PWMpin1, i); analogWrite (PWMpin2, i); analogWrite (PWMpin3, i); analogWrite (PWMpin4, i); delay(50); //wait for half second }
// brightness of the LEDs decreases analogWrite (PWMpin1, i); analogWrite (PWMpin2, i); analogWrite (PWMpin3, i); analogWrite (PWMpin4, i); delay(50);
} digitalWrite(2, LOW); // set the LED off digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(7, LOW); }
Pseudo code
Include header files Function name : setup Return type : void Description : initialization Body : variables initialization for different LEDS. Calling PINMODE function for digital pins utilization.
Function name : loop Return type : void Description : infinite loop Body : digital write operation. Delay operation. Analog Write operation.
Demo Application
Blinky breakout
Proto shield which is used to connect some basic interfaces like LEDs, switches etc.. is mounted on Comet
Different Patterns are generated once you uploading the code to microcontroller .