Code examples for how to use a LEGO® color sensor to automate a LEGO® train with (1) Pybricks and (2) PoweredUp code blocks to go back and forth forever.
LEGO® is a trademark of The LEGO Group of companies, which does not in any way sponsor, authorize, or endorse this content.