Home › Forums › Forums › General discussion › Adding external commands to Navit
- This topic has 2 replies, 2 voices, and was last updated 6 years, 1 month ago by Mark.
- AuthorPosts
- July 31, 2017 at 7:03 am #6753MarkParticipant
I’m an old duffer slowly learning Python and Raspberry Pi 3, but very very slowly am starting to get somewhere. I’m building a motorhome computer (as opposed to a carputer) and after buying your BerryIMU (which worked perfectly out of the packet) I feel that I am getting closer to what I want to achieve.
Part of my design involves Navit and I have followed all of your instructions and everything is working perfectly.
All I need to do now (I think) is add a button onscreen which will allow me to run, for example, BerryIMU.py
I have managed to insert an onscreen button ready to do my bidding, but it doesn’t want to obey me, can you help?
Right hand side of screen we have the zoom in and zoom out buttons and I have added a button underneath which I would like to run BerryIMU.py
I have tried variations of command=’gui.spawn(“BerryIMU.py”)’ and command=’gui.spawn(“python”,”BerryIMU”)’ to no avail. The documentation for Navit isn’t really giving me the examples that I would like it to give me!
Can you help?
Many thanks.
July 31, 2017 at 3:46 pm #6757Mark WilliamsKeymastermaybe you need to include the full path and python
command=’gui.spawn(“python /home/pi/BerryIMU.py”)’
Mark --OzzMaker.com --
August 2, 2017 at 1:32 am #6760MarkParticipantThanks for your quick reply. Sadly that doesn’t work either. Trying to simplify things I have tried just calling Python as in the code below:-
<osd type=”button” x=”-65″ y=”120″ command=”zoom_out()” src=”Zoom_out.xpm” />
<osd type=”button” x=”-65″ y=”180″ command=’gui.spawn(“python”)’ src=”Zoom_out.xpm” />The first line of code is yours, the second is my version.
I’ll try and ask the question on the Navit forum and report back if I get a solution.
- AuthorPosts
- You must be logged in to reply to this topic.