r/ArduinoProjects • • Jan 18 '23

How to get green part of RGB working

Checked breadboard and code and can't see anything that should stop green part of RGB from working. Any help appreciated

2 Upvotes

8 comments sorted by

8

u/freelance-lumberjack Jan 18 '23

Code looks fine, can't see any errors. Suspect wiring.

I would just do an analog write green at the beginning of code to see if it's a hardware issue or software issue.

4

u/Kaiabetes Jan 18 '23

Somehow works after swapping digital pins, shouldn't but does. Beyond giving a shit now

4

u/freelance-lumberjack Jan 18 '23

Lol. Ain't that the way

1

u/Kaiabetes Jan 18 '23

Cheers mate, my heads screwing over this. I'll test it.

4

u/tias315 Jan 18 '23

Maybe your first greenpin was digital only? That may be why you couldn't use analogwrite. Try digitalwrite instead. If you're using analogwrite(255), that's full brightness so it's the same as digitalwrite

3

u/tipppo Jan 19 '23

This seems to be a theme this week. Some drivers, like servo, take over one of the three timer/counters and break the two PWM pins that use that timer. Try another pin.

3

u/TheTrueTuring Jan 19 '23

Exactly that gave more problems for hours until I learned it…