1

Please help me solving this issue.I am working on odroid-c1 board and started with gpio programming and my code is:

import time  
import RPi.GPIO as GPIO  
LED = 22  
GPIO.setmode(GPIO.BOARD)  
GPIO.setup(LED, GPIO.OUT)  
GPIO.output(LED, GPIO.LOW)  
while True:  
    GPIO.output(LED, GPIO.HIGH)  
    time.sleep(0.5)  
    GPIO.output(LED, GPIO.LOW)  
    time.sleep(0.5)   
    GPIO.cleanup()  

I have installed gpio libraries using these commands:

$ tar zxvf RPi.GPIO-0.5.6.tar.gz
$ cd RPi.GPIO-0.5.6
$ sudo apt-get install python-dev python3-dev
$ sudo python setup.py install

and when i tried to run the program i am getting this error:

$ odroid@odroid:~$ sudo python blinky.py  
Traceback (most recent call last):  
  File "blinky.py", line 2, in   
    import RPi.GPIO as GPIO  
  File "/usr/local/lib/python2.7/dist-packages/RPi/GPIO/__init__.py", line 23, in   
    from RPi._GPIO import *  
RuntimeError: This module can only be run on a Raspberry Pi!
2

The RPi.GPIO module only works on a Raspberry Pi. You can't use it on a odroid-c1 board.

  • then which module will work on odroid-c1 for programming with gpio's – vinayashree Jun 16 '16 at 11:15
1

Use the adequate GPIO library: https://github.com/swkim01/RPi.GPIO-OdroidC1

  • @amc This answer might not be written in a perfect way, but it attempts to answer the question by saying "use the linked RPi.GPIO-OdroidC1 module instead of the RPi.GPIO module" as far as I can tell. Please rethink your decision on this post. Thanks. – Byte Commander Jun 16 '16 at 16:42
0

wiringPi module will work for odroid-c1

  • @amc This answer might not be written in a perfect way, but it attempts to answer the question by saying "use the wiringPi module instead of the RPi.GPIO module" as far as I can tell. It has also been written by the OP themselves. Please rethink your decision on this post. Thanks. – Byte Commander Jun 16 '16 at 16:41
  • @ByteCommander ok, but it still needs to add the necessary info to actually do that. – amc Jun 16 '16 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.