(this run but i when checking packages required by IC2 interface the message “unable to install smbus for python 2! Unable to install smbus for python 3!” were received but i did receive the message “install ok installed” so thought it was ok to progress onto next stage.
To test the scroll phat i run the following
“cd ~/pimoroni/scrollphathd/examplespython3 swirl.py”
and received the message “cd: too many arguments”
This makes me think that the issue is with the code i have entered (copied from MagPi) and not any other issues but i am not an expert and would appreciate any help with this please.
As posted above your missing a space or maybe a / between examples and python3.
try python3 /pimoroni/scrollphathd/examples/swirl.py
or cd ~/pimoroni/scrollphathd/examples python3 swirl.py
I tried putting a space or “/” after examples and still received message “-bash : cd : too many arguments”
I then tried “python3 /pimoroni/scrollphathd/examples/swirl.py” and received message "python3 : can’t open file ’ /pimoroni/scrollphathd/examples/swirl.py’ : [Errno 2] No such file or directory
Same error message " -bash: cd: too many arguments"
I have tried another pi zero and another memory card and exactly the same issue. Also when installing script “curl https://get.pimoroni.com/scrollphathd / bash” IC2 interface the message “unable to install smbus for python 2! Unable to install smbus for python 3!” were received but i did receive the message “install ok installed” again.
I have managed to get one led lighting up by manually typing into Python terminal
import scrollphathd as sphd
sphd.set_pixel(0, 1, 0.5)
sphd.show()
but still begs the question of what is the issue is with the command “cd ~/pimoroni/scrollphathd/examplespython3 swirl.py”
cd ~/pimoroni/scrollphathd/examplespython3 swirl.py
is trying to run the change directory (cd) command with 2 arguments when it accepts 1:
~/pimoroni/scrollphathd/examplespython3
swirl.py
You either need to cd into the correct directory (and I think you have a missing / - see below) and then run swirl.py or
run the python program from the parent directory. I.e. either:
cd ~/pimoroni/scrollphathd/examples/python3
python3 swirl.py
The first line will change you into the correct directory, and not I’ve added a / between examplespython3 as examples/python3.
The second line uses the python3 program to run swirl.py
If neither work then does that directory exist? You can cd into each in turn to check or you could
cd ~/pim and press tab. If the ~/pimoroni directory exists it will auto-complete. Note if you get nothing shown press tab twice to get a list of options. Eg: cd ~/Do and tab returns nothing but double-tab provides the options or Documents/ and Downloads/ . Type a letter or two more to make it unique and tab to complete, eg: cd ~/Do tab tab w to make ~/Dow tab to show cd ~/Downloads/ etc.
On my Pi400 the pimoroni folder is labeled Pimoroni with a capital P.
cd pimoroni gets me a no such file or folder.
Try
cd Pimoroni
cd scrollphathd
cd examples
python3 swirl.py
Great news. The approach below worked.
cd Pimoroni
cd scrollphathd
cd examples
python3 swirl.py
How do i clear the “blue text” from the command line?
Also I am curious to know why i was not able to get the first approach to work. For the second part “python 3 swirl.py” i did not start a new line (as i do not know how to) and entered space before. Is that correct?
Thanks for all this everyone i am learning a lot
cd ~/Pimoroni/scrollphathd/examples/
python3 swirl.py
Your first try didn’t work for two reasons. One was you typed pimoroni instead of Pimoroni. And two, it was two separate commands that needed to be entered one after the other. python3 Pimoroni/scrollphathd/examples/swirl.py should do it from the one command.
EDIT: I think doing a cd should get you back to the home folder and clear the blue text.
That or cd home, something like that, my linux skills are pretty basic.
Ok, thanks, I had a feeling you were going to say that. It explains why you were running it from the command line. Nothing wrong with that, It does make for a nice lean install.
I probably should be using lite more often but I almost always go with the with desktop version. On my headless setups, once I’m all done getting it set to go, I just set it to boot to command line instead of the desktop GUI. It’s “almost” as good as running lite.