I have this as last project of the McWorther course: https://wokwi.com/projects/448434128350989313
but as soon as I press the on button I see some white with blue blinking.
Can anyone help me figure out why this happens and how to solve it ?
I have this as last project of the McWorther course: https://wokwi.com/projects/448434128350989313
but as soon as I press the on button I see some white with blue blinking.
Can anyone help me figure out why this happens and how to solve it ?
You will probably get more help if it is a real breadboard and components. As it is the problem can be in one of 3 domains instead of 2. Good luck.
If you read the documentation of the IR library you’ll see they say
Be aware that the hardware timer used for receiving should not be used for
analogWrite().
Especially motor control often uses theanalogWrite()function and will therefore stop the receiving if used on the pins indicated here.
Have you verified you use the correct pins ? If not, That would be the first thing to check out…
As far as I can see the wiring is allright.
I get a code when I press a button.
On what pins are your leds ?
What does the doc state about the MCU for the UNO (look in the column labeled analogWrite() pins occupied by timer)
I gave you the link…
As far as I understand the processor on Uno v3 is this :
ATmega328 1, 2 9, 3 9 & 10, 3 & 11
And my leds are on 9, 10 and 11
But when I change it to 5,6,7 the blinking stays
The blink is not blue all the times. I saw green too. Isn’t it just something inherent to Wokwi?
I have to repeat my experiment, but I removed all the IR stuff and the LED was not solidly magenta (255, 0, 255) so ATM I have to blame the wowki simulator.
This is unusual, so.
a7
Yes so first thing to do would be not using 9 10 and 11 and pick 3 pins that have PWM capability (the little ~ next to the PIN number on the uno is a hint)
As you can see 5 and 6 are ok but not 7. (And you are out of pins)
Also you should set the color only once not at every spin of the loop. There is no need.
oke
I will try again with 3 ports who have no pwm.
I choose to set the color because on other presses I have to set another color.
No,
Like your original choice of 9, 10 and 11.
a7
No, you need pwm for analog write to do its magic.
I misspoke not the 4 pins are blocked - check the default timer you use and that will be 2 pins blocked. So you have enough, just pick the right ones.
Sorry
Now in confused
Oke, I choose now 9, 6 and 3 for the leds but still the same problem.
I’m on my phone not easy to check it all.
Default timer is timer 2 so you can’t use 3 and 11
I think this confirms posts #7 and 8.
I repeated my experiment and got the same odd result.
Curiously, the wokwi RGB LED demos work fine, both on the original PWM pins as well as when moved to 9, 10 and 11.
???
a7
oke, because JML said i cannot use 3 and 11
I use now 10, 9 and 6 with the same wierd outcome.
Here
the RGB LED works fine…
So, it's not the IR stuff, and it isn't anything else either. ![]()
a7
I see it also
When I delete the ir stuff and place the analogwrite in the loop or in setup
The blinkering stays.
When you do all the stuff at the top so the color is white I see the same blinkering.