I'm quite new when concerning Arduino although I work in IT since many years.
Lately I decided to start some fun with Arduino and for that I bought a cheap Arduino uno r3 from aliexpress (CH340 Atmega 328p). After having terrible problems with installing it under Linux I decided to compile and run simple led blinking project (one of typical examples from net). However led was blinking irregularly thus not as I would expect when using delay function.
I would expect that the counter will increase one by one in the regular time intervals. However time intervals seems to be partially random and the order of counter is the following (one of examples):
In my humble opinion this module doesn't work correctly. Am I doing sth wrong or is that a problem with arduino device? Any reset, recompiling etc. don't help.
Thanks for suggestions.
P.S. Serial port speed is set the same at computer as for arduino program.
How do you have your LEDs wired up? Do you have current limiting resistors installed? Typically a 220 ohm resistor.
What happens if you comment out all 4 of your digitalWrite() calls inside loop(). If that fixes the problem, you probably have something wired up wrong and pulling to much current.
Concerning board, I selected Arduino Uno. Should I select sth different?
Concerning resistor, I use 330ohm resistor.
Earlier I tried to use D13 on board led and it was the same. Blinking was irregular.
I commented all led instructions, leaving only delays and println and I have the same, the counter doesn't count one by one, but in random way. Example:
1
2
16519
0
1
0
1
2
3
0
1
2
Might it be somehow related with using incorrect libraries? Does Arduino have any watch dog system?
I find sth that this device should be visible as WeMos D1. However when installing esp2866com according to this manual: Installing — ESP8266 Arduino Core 3.1.2-21-ga348833 documentation installation is fine but when reruning arduino ide, i can't see new devices to select.
Well, I find a problem with weMos D1 library. The description at the page given above is incorred. If I call the directory 1.8.6 instead of esp8266 then IDE starts seeing the libraries. However for all Wemos D1, compiling is fine, but when sending it to device I get error.
Moreover I added static to counter variable, but it didn't change anything (as static probably here doesn't matter).
However when i look on Wemos D1 devices on Internet, they look fully different than mine thus I doubt if it was the right idea. Please have a look on my device: https://pl.aliexpress.com/item/1005006038084112.html
Concluding everything shows that my device is damaged. I think it might be sth wrong with memory.