hi
i am going to interface the button with raspi model b the code is
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
but it give me the following error
attribute error: module object has no attribute setmode
what the problem is and how to solve it please?
-
- Posts: 38
- Joined: Fri Apr 15, 2016 3:39 am
- MarkHaysHarris777
- Posts: 1820
- Joined: Mon Mar 23, 2015 7:39 am
- Location: Rochester, MN
- Contact: Website
Re: button interfacing
Make sure that none of your own modules are called RPi.GPIO
... otherwise, that name will get imported instead of the PI version...
There is nothing wrong with your syntax... so the problem has to be a naming problem.
marcus
... otherwise, that name will get imported instead of the PI version...
There is nothing wrong with your syntax... so the problem has to be a naming problem.
marcus
marcus


-
- Posts: 38
- Joined: Fri Apr 15, 2016 3:39 am
Re: button interfacing
ok thanks
Re: button interfacing
Or a VERY old version of the RPi.GPIO library that goes back several years before the developer implemented the setmode function.MarkHaysHarris777 wrote: There is nothing wrong with your syntax... so the problem has to be a naming problem.