RPi.GPIO library using error.

voxventi
New Member Posts: 5 ✭
When I try RPi.GPIO example from wiki And code here;
import RPi.GPIO as GPIO import time # Pin Definitons: ledPin = 4 # Pin Setup: GPIO.setmode(GPIO.BCM) GPIO.setup(ledPin, GPIO.OUT) # LED pin set as output print("Here we go! Press CTRL+C to exit") try: while 1: GPIO.output(ledPin, GPIO.HIGH) time.sleep(0.5) GPIO.output(ledPin, GPIO.LOW) time.sleep(0.5) except KeyboardInterrupt: # If CTRL+C is pressed, exit cleanly: GPIO.cleanup() # cleanup all GPIO
And I run this command on terminal:
python3 ledblink.py
I get this error message;
Traceback (most recent call last): File "ledblink.py", line 1, in <module> import RPi.GPIO as GPIO File "/home/rnd/.local/lib/python3.8/site-packages/RPi/GPIO/__init__.py", line 23, in <module> from RPi._GPIO import * RuntimeError: This module can only be run on a Raspberry Pi!
How can i fix that?
Edit1: According to wiki UPBoard supports RPi.GPIO library
Answers
Tagged
Categories
- 303 All Categories
- 104 Announcements & News
- 52 Product News - New Product/Product Change Notice/ End-of-life
- 184 Welcome Developers!
- 53 Unboxing & Project Sharing
- 24 Tech Updates
- 595 UP Products
- 6 UP Xtreme i12
- 1 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 13 UP Squared V2
- 41 UP 4000
- 24 UP Xtreme i11
- 34 UP Squared 6000
- 49 UP Squared Pro
- 140 UP Xtreme
- 828 UP Squared
- 1.4K UP Board
- 89 UP Core Plus
- 221 UP Core
- 3 UP Xtreme Lite
- 44 UP AI Edge
- 215 Starter Kits & Peripheral