Raspberry Pi - LED Tutorial (with Python 3)

Поделиться
HTML-код
  • Опубликовано: 29 окт 2024

Комментарии • 4

  • @barkekev
    @barkekev 2 года назад +1

    Is it possible that CTRL+C could result in the cleanup function not running correctly?
    My thinking is this:
    When you press CTRL+C the program starts the cleanup when the CTRL key is pressed, but when you click 'C' it will terminate the program regardless of your cleanup state. This means that the cleanup function needs to finish running in between CTRL being pressed and C, which could result in the cleanup function being cut short. This can be mitigated if you press just 'C' or just 'CTRL', or any other non breaking code keyboard combinations.
    I've never coded in python before so could be wrong about the catch block trigger being any keyboard key though.

    • @RoboticsBackEnd
      @RoboticsBackEnd  2 года назад

      Hey Kevin, almost correct :)
      Actually pressing CTRL+C is just one action, and it will try to terminate the running program. As the program is "stuck" inside a loop, it will end from there, and the GPIO.cleanup() line won't be called.
      Solution to that --> check at 8:30 in the video

  • @MischiefMemoirs
    @MischiefMemoirs Год назад

    GETTING THIS ERROR WHEN i TRY TO RUN @No module named 'RPI'