Raspberry Pi - LED Tutorial (with Python 3)

preview_player
Показать описание
Learn how to control an LED with your Raspberry Pi and Python 3, step by step: Circuit, code, and best practices.

0:00 Intro
0:19 Circuit with Raspberry Pi and LED
3:15 Power on the LED with Python3
7:18 Make the LED blink indefinitely
10:49 Outro

Рекомендации по теме
Комментарии
Автор

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.

barkekev
Автор

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

MischiefMemoirs