FreeBASIC and the Raspberry Pi ?

General discussion for topics related to the FreeBASIC project or its community.
dasyar
Posts: 372
Joined: Dec 04, 2008 15:31

Re: FreeBASIC and the Raspberry Pi ?

Post by dasyar »

@BasicCoder2
Are you using the hello.bas that is in the examples folder? If not, I think you need to have a sleep, in the code, to keep the program running.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Post by BasicCoder2 »

srvaldez wrote:geany does not have a quick run F5, you must compile then run your program.
The version that came with Raspian does show F5 as a hot key for the menu Build -> Execute item
However Build/Execute (F5) just pops up a geany_run_script_5ZLBGZ.sh titled window
Every time I Build/Execute it comes up with another run_script window with a different combination of letters and numbers in the title.
Clearly I need to read a geany tutorial.

Image
Image
Image
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Post by BasicCoder2 »

dasyar wrote:Are you using the hello.bas that is in the examples folder? If not, I think you need to have a sleep, in the code, to keep the program running.
Yes I am using hello.bas and it does have a sleep command.
The program does not compile and run it just compiles. I don't know how to make it run. The Execute command just pops up a window (see previous post). Perhaps another editor would be better to use. I see FBIDE which I use in MSWindows also works in Linux. It is just a matter of figuring out how to configure it with fbc as that was done automatically when I downloaded the FBIDE/FreeBASIC combo for Windows. I don't know enough about how Linux works yet.
dasyar
Posts: 372
Joined: Dec 04, 2008 15:31

Re: FreeBASIC and the Raspberry Pi ?

Post by dasyar »

I just checked to see how a hello.bas works with my setup and Geany, it seems to work as expected. Just to be on the safe side do:
sudo apt-get update
sudo apt-get install geany

The one thing that I noticed with my setup is that the fbc install does not have an examples folder, and I noticed that it seems like the include folder does not contain all of the .bi files, but I could be wrong on this.

I was kind of hoping that FreeBasic would have an official Raspberry Pi install package.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Post by BasicCoder2 »

dasyar wrote:I just checked to see how a hello.bas works with my setup and Geany, it seems to work as expected.
So what are the actual steps you take to compile the source code into an .exe ? Does your version have the same menu choices? Have you made any manual settings to Set Build Commands?
Image
dasyar
Posts: 372
Joined: Dec 04, 2008 15:31

Re: FreeBASIC and the Raspberry Pi ?

Post by dasyar »

In the folder that you compiled the hello.bas program, there should be two files, the hello.bas and hello(executable file). Double click on the hello file, there should be another window that opens up, asking how to run it, choose the terminal window.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Post by BasicCoder2 »

@dasyar,
That worked thanks. A graphic example also worked.
Much rather run a program from the IDE however as it is a bit tedious going via the File Manager.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FreeBASIC and the Raspberry Pi ?

Post by D.J.Peters »

In your home folder is a hidden folder named ~/.config
(the point in front of a file or folder makes it hidden)

In this folder many apps save the settings.

In case of geany it's:

"~/.config/geany/geany.conf"

!!! Close geany if it's running !!!
Open the file with an editor and edit near the section [tools]

[tools]
terminal_cmd=x-terminal-emulator --command="/bin/sh %c"

Before you delete the current line make a copy or write it down and post it here.

Joshy
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Post by BasicCoder2 »

.
Last edited by BasicCoder2 on Mar 25, 2018 0:33, edited 1 time in total.
dasyar
Posts: 372
Joined: Dec 04, 2008 15:31

Re: FreeBASIC and the Raspberry Pi ?

Post by dasyar »

@BasicCoder2-
Since your hello program got compiled and runs as expected, I think maybe your Geany program got disrupted somehow. What I would do is:
sudo apt-get update
sudo apt-get install geany
If it comes back with a "geany is already installed" message, then I would do:
sudo apt-get remove geany
do another:
sudo apt-get update
just to be sure, then
sudo apt-get install geany
this should give you a fresh installation of geany. Now, I would go back and try the Geany IDE again.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Post by BasicCoder2 »

@dasyar,
That didn't make any difference however I think I have found the relevant config file.
Last edited by BasicCoder2 on Mar 25, 2018 0:34, edited 1 time in total.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Post by BasicCoder2 »

D.J.Peters wrote:In your home folder is a hidden folder named ~/.config
(the point in front of a file or folder makes it hidden)

In this folder many apps save the settings.

In case of geany it's:

"~/.config/geany/geany.conf"

!!! Close geany if it's running !!!
Open the file with an editor and edit near the section [tools]

[tools]
terminal_cmd=x-terminal-emulator --command="/bin/sh %c"

Before you delete the current line make a copy or write it down and post it here.

Joshy
terminal_cmd=x-terminal-emulator -e "/bin/sh %c"

Execute works!

When I use the screenres command what should type in the geany.conf file to prevent the terminal window also appearing?


Image
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FreeBASIC and the Raspberry Pi ?

Post by D.J.Peters »

So far I know geany needs the console to execute the fresh build.
Your compiled binary can be executed via mouse from file manager without a console window.

I use the console for debug outputs.
So the console is more a feature while develop a program.

But may be I'm wrong.

Joshy
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Post by BasicCoder2 »

D.J.Peters wrote:Your compiled binary can be executed via mouse from file manager without a console window.
Yes you are right. It works fine that way. The console window is not an issue when developing a program.
It has been a long drawn out process but may I thank everyone who has helped me get FreeBASIC working on the Raspberry Pi.
I have found examples of ARM assembler code to control the PINS so my next task will be learning enough to use it in a FreeBASIC program.
dasyar
Posts: 372
Joined: Dec 04, 2008 15:31

Re: FreeBASIC and the Raspberry Pi ?

Post by dasyar »

When I use the screenres command what should type in the geany.conf file to prevent the terminal window also appearing?
I do the quick and dirty, add -s gui to the compile command.
Post Reply