Needing help, trying to see if I could use a function (define) something in my python code using Visual Studio Code and optical sensor.
This is what I got, trying to remember and translate from my C++ time:
rollerw = Motor(Ports.PORT13, GearSetting.RATIO_18_1, True)
colorsense = Optical(Ports.PORT4)
def redUp(speed):
rollerw.spin(FORWARD, speed, VelocityUnits::PERCENT, False)
while not colorsense == Color.RED:
pass
rollerw.stop
Now of course this doesnt work, but I’m going off limited knowledge and just trying to see what I can do…