ModMyPi LTD | Ryanteck RTk.GPIO [1]

von Satoshi Nakamoto

ModMyPi LTD | Ryanteck RTk.GPIO

This tutorial will go over writing your first program and utilizing the RTk.GPIO and assumes you've got already adopted the information to put in python and the library put in. If not observe the information right here.

I am nonetheless scripting this. The demo code beneath ought to work fantastic when you change the quantity 22 to the pin which an LED is linked to (I used Pin 22 as its Inexperienced on the TrafficHAT. Altering it to four ought to blink the blue LED on the Explorer HAT.

Open your favorite IDE

Open your favorite IDE or only a python shell in a terminal to start with.


from RTk import GPIO
from time import sleep

LED = 22
GPIO.setmode(GPIO.BCM)
GPIO.setup(LED,GPIO.OUT)

whereas True:
GPIO.output(LED,1)
sleep(1)
GPIO.output(LED,0)
sleep(1)



Source link

Read the full article
Porträt von Satoshi Nakamoto

Satoshi Nakamoto

Zur Person

Satoshi Nakamoto