Can some one please send me an arduino program which alternates led brightness | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can some one please send me an arduino program which alternates led brightness

ardino

1st Mar 2018, 7:23 PM
Ayo Alabi
Ayo Alabi - avatar
30 Answers
+ 2
You can use pwm for that. Call analogWrite(255) on you digital output pwm pin. The value can be between 0 - 255 which is 0 - 5v. analogWrite(127) means that the pwm duty cycle is 50% and the output voltage is 2.5V. int brightness = 255; int pwm = 6; void setup { pinMode(pwm, OUTPUT) } void loop { analogWrite(pwm, brightness); brightness = brightness - 1; if(brightness == 0) { brightness = 255; } } You could also connect a potentiometer to your analog input. void loop() { analogWrite(pwm, analogRead(A0)); } Please note that analogRead() returns a value between 0 and 1023.
1st Mar 2018, 8:34 PM
Toni Isotalo
Toni Isotalo - avatar
+ 1
the outer gate has a Paper, open the gate and move forward then you will See a dor With anet open the net dor- stuff and knock
2nd Mar 2018, 11:04 PM
Justice Ugochukwu
+ 1
Someone will come (fejiro) no need to say anything
2nd Mar 2018, 11:12 PM
Justice Ugochukwu
+ 1
she is very nice and hospitable
2nd Mar 2018, 11:20 PM
Justice Ugochukwu
+ 1
rhonor will take u to fejiro or call fejiro to meet u then u get started . PS the game u promised
2nd Mar 2018, 11:23 PM
Justice Ugochukwu
+ 1
probably by 3 because i am having lesson (Isolog akute)
2nd Mar 2018, 11:45 PM
Justice Ugochukwu
+ 1
just come and besides he usually opens the door and I am not coming late and the game
3rd Mar 2018, 12:27 AM
Justice Ugochukwu
+ 1
i wana to shoo u a game but i don't know how to but i saved the code check my profile
3rd Mar 2018, 12:39 AM
Justice Ugochukwu
+ 1
(html)
3rd Mar 2018, 12:39 AM
Justice Ugochukwu
+ 1
kk
3rd Mar 2018, 12:50 AM
Justice Ugochukwu
+ 1
come I am in Fejiro's 🏡 PS what is your address please
3rd Mar 2018, 3:00 PM
Justice Ugochukwu
+ 1
hello Ayo y aren't u online
4th Mar 2018, 4:20 PM
Justice Ugochukwu
+ 1
y did u start learning sql
4th Mar 2018, 4:21 PM
Justice Ugochukwu
+ 1
yes u are online
4th Mar 2018, 4:34 PM
Justice Ugochukwu
+ 1
arduino is programmed in cpp
1st Jun 2018, 5:13 PM
Ugochukwu Justice
Ugochukwu Justice - avatar
0
thank you
2nd Mar 2018, 10:49 PM
Ayo Alabi
Ayo Alabi - avatar
0
Google it loser
2nd Mar 2018, 10:51 PM
Justice Ugochukwu
0
when I get to fejiros house should I knock and shout fejiro!!!
2nd Mar 2018, 10:59 PM
Ayo Alabi
Ayo Alabi - avatar
0
when I knock what will I say
2nd Mar 2018, 11:06 PM
Ayo Alabi
Ayo Alabi - avatar
0
was the code you posted in CPP?
2nd Mar 2018, 11:06 PM
Ayo Alabi
Ayo Alabi - avatar