顯示具有 範例 標籤的文章。 顯示所有文章
顯示具有 範例 標籤的文章。 顯示所有文章

2022-06-25

EV3 Python 程式範例

用 Python 撰寫程式控制 EV3 

EV3 主機的狀態燈

Code

  1. #!/usr/bin/env pybricks-micropython
  2. from pybricks.hubs import EV3Brick
  3. from pybricks.tools import wait
  4. from pybricks.parameters import Color
  5. # Initialize the EV3
  6. ev3 = EV3Brick()
  7. # Turn on a red light
  8. ev3.light.on(Color.RED)
  9. # Wait
  10. wait(1000)
  11. # Turn the light off
  12. ev3.light.off()


以下是其他 EV3 Python 範例程式