Search code examples
webots

Thymio-II Webots Python simulator


I am trying to program Thymio-II using Python in Webots simulator. I have not understood how to access and control LEDs on Thymio-II. Are there any Python controller code examples for Thymio-II which would illustrate use of LEDs? Thanks!


Solution

  • Take a look at this C example and you will understand how to access all the LEDs of the Thymio-II in Python:

    led = robot.getLED('leds.circle.led0')  # get a reference to one of the LEDs of the robot
    let.set(32)  # turn on the LED