adafruit / Adafruit_DotStar_Pi

DotStar module for Python on Raspberry Pi
GNU General Public License v3.0
60 stars 30 forks source link

Noobie question #12

Closed philspitlerSF closed 5 years ago

philspitlerSF commented 8 years ago

hi, I am new to the pi and Python and get this error when trying to run the strandtst.py.

I am using a piZero. Also I see there is an SPI and a bitbang mode, where do I switch the mode?

Also, am I correct to run the code by typing "python strandtest.py"

Thanks.

pi@raspberrypi:~/LED/Adafruit $ python strandtest.py Can't open /dev/mem (try 'sudo') Traceback (most recent call last): File "strandtest.py", line 28, in strip.begin() # Initialize pins for output SystemError: error return without exception set

hairyhenderson commented 8 years ago

@philspitlerSF - try this command instead:

$ sudo python strandtest.py

The sudo command tells Linux to run the following command as the root user, which gives the command additional privileges that it wouldn't otherwise have (such as access to /dev/mem, as you see in the error).

d4nc3rmon commented 7 years ago

I am using a Rapsberry Pi 3 and am having this same error. When I use sudo however the error doesn't come up, instead everything just sits idly. Nothing happens on the board,lights, pi, or on the terminal line. There's not even a "$" so I can type more code.

PaintYourDragon commented 7 years ago

If nothing in the console, that means the code's running OK. If the DotStars aren't lighting, could be wired to the wrong pins (clock & data may be reversed, or you might be counting physical pin numbers -- code wants Broadcom GPIO pin numbers).