Professional Documents
Culture Documents
Project 3 Little Star
Project 3 Little Star
1.Project Introduction
signal level.
Card*1
motor.
the ON and OFF time fast enough then the brightness of the
with PWM.
high for half a second and will be low for the other half
and OFF per second), then the led will be seen glowing at
and we can give the value from 0-255 using this function.
analogWrite(0) means a signal of 0% duty cycle.
6, 9, 10 and 11.
In this project, you are going to learn how to get the PWM
output from the digital pins of Mega Plus board and control
4.Circuit Connection
How to connect an LED
/*
Project 3
Little Star
http//www.keyestudio.com
*/
int ledPin = 6;
void setup()
pinMode(ledPin,OUTPUT);
void loop(){
analogWrite(ledPin, value);
delay(5);
analogWrite(ledPin, value);
delay(5);
}}
/////////////////////////////////////////////////////////////////
1.Open up the Arduino IDE and copy the below code into a
new sketch.
2.Select the correct Board type and COM port for the
Arduino IDE.
6.Project Result
Done uploading. You will see the LED lights gradually light