I would like to ask if it is possible to dim LEDs with the NANO just by using the programming software, without any potentiometers etc.
I researched this quite a lot and found nothing. I managed to do it on an Arduino UNO where it stays at ~40% brightness, but so far no success on the NANO.
use the word 'fade' in your research rather than dim, although my 2 seconds of research consisting of typing 'dimming an led with arduino' into google got the right answer first result. Weird!
I researched this quite a lot and found nothing. I managed to do it on an Arduino UNO where it stays at ~40% brightness, but so far no success on the NANO.
Hi,
Can you please post the UNO code, the NANO is just a smaller version of the UNO with some extra analog inputs.
Please read the post at the start of any forum , entitled "How to use this Forum".
OR http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Did you try just loading the code onto the NANO?
Can you post a copy of your circuit please?
Thanks.. Tom...
**Since I am a newbie I definitely bought copies of Arduino- I checked last night the difference between genuine and fake. I went ahead and ordered 2 genuine Nano Every from here.
(I took the dimming code and edited it to keep the LED "permanently" on at <50% of its maximum brightness, as that was what I was looking for, for my project).
Here it is working on the UNO (connected to pin 6, code was modified to reflect that):
Here it is connected to the Nano (I tested it on pins D3, D6, D9 etc. the PWM pins from what I've learned)
On the nano clone, it doesn't work at all.
One observation, if I connect it to pin D12, without any code, it blinks at normal speed at full brightness and if i connect it to GND and 5V it stays on- naturally, as that bypasses any code I presume.
Hi,
Please read the post at the start of any forum , entitled "How to use this Forum".
OR http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
sterretje:
Funny code. Fill in numbers for brightness and manually verify the effect of it on your if condition.
If you just want a certain level, why not use analogWrite() in setup()?
Please be aware that a Nano is not the same as a Nano Every.
Thank you for the observation. Yeah, I am a newb. I usually practice workarounds. And this is slightly out of my depth as I have never programmed before.
I guess I will post "help with my code" in the correct section.
Although this still doesn't seem to answer the issue on what is wrong with the NANO.
I read on the differences between NANO and EVERY, but in terms of programming and the software, wouldn't they behave in a similar fashion?
I did. I tried all PWM. After exhaustive research I found the following:
The Chip CH340 is most likely the fault, as in a lot of the Chinese copies the Bootloader is either messed up or not even pre-loaded.
I tried to run Arduino ISP from my UNO which works but I cannot get it to compile w/e I do. So I ruled it out that both Nanos that I have are useless as it is not worth my time to keep at it when I can buy 5 more off Amazon for under $20.
I also rewrote the code to have no loop on it, just the AnalogWrite in the setup and it seems to work ok like that as well.
So thank you all for your input. I suppose this is the end of this road.