Created as a showcase project, AMAZE-28, the single-room summer house, was successfully constructed within 28 days on the grounds of the Kerala State Nirmithi Kendra. The 3D-printed building at the Kerala State Nirmithi Kendra in Thiruvananthapuram. (Photo: Shekunj) The inauguration of Kerala's inaugural 3D-printed structure, a 380-square-foot single-room summer house, is scheduled to take place on October 10 at the Kerala State Nirmithi Kendra (Kesnik) campus located in PTP Nagar, Thiruvananthapuram. Conceived as a showcase initiative, the summer house named AMAZE-28 was successfully finished within a mere 28 days. This impressive project was executed by Tvasta, a construction technology startup based in Chennai, founded by alumni of IIT-Madras, who have entered into a memorandum of understanding (MoU) with Kesnik. AMAZE-28 is perched upon a concrete foundation atop a gentle elevation within the Kesnik campus. Febi Varghese, the Director and Chief Executive Officer of...
Hi Friends!!!!!!
We have learnt how to blink LED with the help of Arduino, that's great! But now we will learn how to make a LED fade in and out gradually using a function in arduino : analogWrite();
Let's have a look on components, which we are going to need ahead.
COMPONENT NEED -
- Breadboard (1)
- Arduino (1)
- Jumper Wires
- LED 5mm (1)
- Resistor1K ohm (1)
- Power Source 5V (1)
Now we place these components to make a proper circuit.
CIRCUIT PREPRATION -
Black wire - GND
Red Wire - +5V
Take the breadboard and arduino. Connect the GND from arduino to -Ve terminal on breadboard. Similarly +5V to the +Ve terminal on breadboard.
Now place the LED on breadboard. Connect the positive terminal of LED to the 9th pin of arduino.
Why we connecting the LED to the pin 9 of arduino ????
Because pin 9 of arduino can be used for PWM purpose. We needed PWM (Pulse Width Modulation) because Arduino board can only give digital signal (HIGH or LOW) and we need to control the brightness of LED between ON and OFF, and this is possible by analogwrite(); , it simulates the appearance of brightnesses between on and off using pulse width modulation (PWM).
Here we have completed our circuit, now lets have a look on our code.
CODE -
To download complete code - CLICK HERE
-----------------------------------------------------------------------------------------------------------
int led = 9; // led attached to this PWM pin 9.
int brightness = 0; // to set the brightness level
int fadeAmount = 5; // to fade the led by this amount
void setup()
{
pinMode(led, OUTPUT);
}
void loop()
{
analogWrite(led, brightness);
brightness = brightness + fadeAmount;
if(brightness <= 0 || brightness >= 255)
{
fadeAmount = -fadeAmount;
}
delay(1000);
}
int brightness = 0; // to set the brightness level
int fadeAmount = 5; // to fade the led by this amount
void setup()
{
pinMode(led, OUTPUT);
}
void loop()
{
analogWrite(led, brightness);
brightness = brightness + fadeAmount;
if(brightness <= 0 || brightness >= 255)
{
fadeAmount = -fadeAmount;
}
delay(1000);
}
-----------------------------------------------------------------------------------------------------------------------------
Upload the above code in your Arduino. And here we have completed our project. Let's have look on simulation of above project.
SIMULATION -
To watch the simulation CLICK HERE
Comments
Post a Comment