My Account

Wish List (0)

Ryanteck RTk.GPIO - Getting Started

in RyanTeck, RyanTeck RTk.GPIO on .

This tutorial will go over writing your first program and using the RTk.GPIO and assumes you've already followed the guide to install python and the library installed. If not follow the guide here.

I'm still writing this. The demo code below should work fine if you change the number 22 to the pin which an LED is connected to (I used Pin 22 as its Green on the TrafficHAT. Changing it to 4 should blink the blue LED on the Explorer HAT.

Open your favourite IDE

Open your favourite IDE or just a python shell in a terminal to begin with.

from RTk import GPIO
from time import sleep
 
LED = 22
GPIO.setmode(GPIO.BCM)
GPIO.setup(LED,GPIO.OUT)
 
while True:
    GPIO.output(LED,1)
    sleep(1)
    GPIO.output(LED,0)
    sleep(1)
Last update: Nov 01, 2017

Related Article

Related Products

Comments

Leave a Comment

Leave a Reply

The product is currently Out-of-Stock. Enter your email address below and we will notify you as soon as the product is available.