Timeline for Why does an LED sometimes flash when increasing brightness?
Current License: CC BY-SA 3.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
S Jan 8, 2016 at 16:38 | history | suggested | Greenonline | CC BY-SA 3.0 |
Fixed minor typos and added code formatting
|
Jan 4, 2016 at 7:16 | review | Suggested edits | |||
S Jan 8, 2016 at 16:38 | |||||
Nov 21, 2015 at 13:58 | comment | added | brtiberio | yes it does, I've suggested that in first sentence. But in case he really wanted for any reason or just curiosity this should be the way. In fact the problem relies on how analogWrite function handles values of 0 and 255 without changing the registers | |
Nov 21, 2015 at 13:35 | comment | added | Gerben |
Wouldn't analogWrite(led,1) accomplice a similar effect to sbi(TCCR2A, COM2A1);OCR2A = 0; ? I.e, setting the duty cycle to a very low value, just before setting the output to LOW. That would make it a lot more readable.
|
|
Nov 21, 2015 at 0:03 | comment | added | Adrian | Thanks a lot for the help, explanation and for the link. I can basically see how to do it now. I think you can also find all of the code in \hardware\arduino\avr\cores\arduino. | |
Nov 21, 2015 at 0:00 | comment | added | brtiberio | @Adrian I've edit to explain a bit of those codes and arduino IDE complains if I do not made that include. I'm not really an expert but if you want to dig in, the datasheet of atmega is your friend. This should be used in kinda of advanced way. What arduino.cc team did ( and that is the real beauty that change a bit everyone's world) was create simple functions that don't need typical user to dig into datasheets and some registers settings. They kinda made simple what could be hard for not so experienced people. However if you really need you can look at all code in github of arduino | |
Nov 20, 2015 at 23:52 | history | edited | brtiberio | CC BY-SA 3.0 |
edit to explain OCR2A codes as in comments is shorter
|
Nov 20, 2015 at 23:20 | comment | added | Adrian | Also, how do you learn how to use these libraries in the first place?? | |
Nov 20, 2015 at 23:14 | comment | added | Adrian | Thanks @Personagem, I will test it, but could you please explain the use of sbi, TCCR2A, COM2A1, and OCR2A. Also, considering that wiring_private.h is of the included header files in the Arduino directory, is it necessary to include it? | |
Nov 20, 2015 at 23:14 | vote | accept | Adrian | ||
Nov 20, 2015 at 19:58 | history | edited | brtiberio | CC BY-SA 3.0 |
added 133 characters in body
|
Nov 20, 2015 at 19:38 | history | answered | brtiberio | CC BY-SA 3.0 |