Originally published by r/legomindstorms

Trouble making Pybricks code

Discovered for you from r/legomindstorms

Okay, so I'm trying to make a program just trying to demonstrate the ultrasonic sensor being used with the Pybricks language as example programs. Python is not my strong suit. However, with my current code, it doesn't smoothly update whenever the value changes. It seems to stay a flat value whenever distance changes. while True: if sensor.distance() >= 300: soulsofdamned.straight(lah) elif sensor.distance() <= 100: soulsofdamned.straight(-lah) else: soulsofdamned.stop() (lah =...

<category term="legomindstorms" label="r/legomindstorms"/>

Read the Full Article

This is a summary. Read the complete story at r/legomindstorms.

Read Full Article on r/legomindstorms