Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

blinking an led with raspberry pi

import RPi.GPIO as GPIO # IMPORTANT: remember to change the gpio pin (18) also it needs to be programmed in Thonny Python IDE
import time #used in raspberry pi model 4

GPIO.setwarnings(False) #NOTE: raspberry pi could be updated, and you might need to change your code
GPIO.setmode(GPIO.BCM) 
GPIO.setup(18, GPIO.OUT)


while True:
      GPIO.output(18, True) 
      time.sleep(1) 
      GPIO.output(18, False) 
      time.sleep(1) 
Comment

PREVIOUS NEXT
Code Example
Python :: strip comma from string python 
Python :: euclidean division in python 
Python :: python datetime no milliseconds 
Python :: how to get a dataframe column as a list 
Python :: pandas drop na in column 
Python :: multiple inputs in python 
Python :: pandas add two string columns 
Python :: pandas dataframe scan column for values between numbers 
Python :: python trie 
Python :: python game engine 
Python :: python check for folder 
Python :: create virtual env 
Python :: add hour minutes second python 
Python :: dataframe change column value 
Python :: make dataframe index a column 
Python :: python set negative infinity 
Python :: how to do date time formatting with strftime in python 
Python :: how to use ggplot matplotlib 
Python :: new window selenium python 
Python :: discord.py get user input 
Python :: seaborn correlation 
Python :: distinct rows in this DataFrame 
Python :: getting the file path of a file object in python 
Python :: starting vscode on colab 
Python :: python not jump next line 
Python :: left click pyautogui 
Python :: max pooling tf keras 
Python :: SQLAlchemy query to dict 
Python :: reverse geocode python 
Python :: how to say something python 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =