GLBasic and Ardunio?

Previous topic - Next topic

planetm

Has anybody tried using an Arduino ( http://www.arduino.cc/ ) with glbasic? People have already got them interfaced with quite a few other packages ( http://www.arduino.cc/playground/Main/InterfacingWithSoftware ). I'm waiting for my Arduino to arrive and It occurs that I could have a lot of fun using it to control things in glbasic (a quick and easy example being making my own paddle controller for breakout/arkanoid using a potentiometer, but a few people have got them working with the wii nunchuck which would be interesting too).

I don't think glbasic has the ability to directly communicate with usb/serial ports, but guess it might be possible using inline and some C code, but my knowledge of C is pretty much zero. There is a page about communicating with an Arduino using C at http://todbot.com/blog/2006/12/06/arduino-serial-c-code-to-talk-to-arduino/ and the code is at http://todbot.com/arduino/host/arduino-serial/arduino-serial.c

Has anybody tried this already? Would integrating the C code be possible? My Ardunio should arrive later this week, so if somebody can point me in the right direction (I'll need a lot of direction!)  I'll add interfacing with glbasic to my list of ideas!

Thanks,

Matt.

bigsofty

Both integrating (Inline) and interfacing (using the headers) the commands would be possible with GLBasic, its a pretty specialised piece of kit though and hard to test without the board...
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

planetm

Thanks for the reply, can you give me any pointers on how to start the integration/interfacing once I have the board in-hand?

I have no problems using the board itself, and the electronics side is fine, as is the usual glbasic stuff - it's the inline and C that are an enigma to me!

trucidare

Code (glbasic) Select
FUNCTION foo:  // Function to get out of GLBASIC Window
ENDFUNCTION

INLINE  //Start Inline
}  // End of the GLBASIC Namespace
    #include "Files.h";   // Files to Include

//Code
namespace __GLBASIC__{   //Returning to GLBASIC Namespace
ENDINLINE  // End of INLINE
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

planetm

Ok, having read some more on inline again, and specifically Gernots opengl example http://www.glbasic.com/forum/viewtopic.php?pid=4031#p4031 I think I could have a go at getting this to work. I'll post again when/if I have any success or otherwise!

bigsofty

One thing Planetm, there is a header pack that Gernot posted that has all the standard C functions, nicely integrated into the GLBasic directory structure, get this is you want to do anything with C easily ;)
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

planetm

Although I'm still waiting for the hardware I've made a start on this... I grabbed the headers that Gernot posted elsewhere ( http://www.glbasic.com/files/headers.rar ) and have extracted them. However, there are two includes in the C code which don't seem to be in this pack:

Code (glbasic) Select
#include  /* POSIX terminal control definitions */
#include
I assume these allow communication via a serial port. Where would I find the necessary files which would be compatible with the one's I've already extracted?

Kitty Hello

yikes! That's headers for linux. What target os do you want?

planetm

Quote from: GernotFrischyikes! That's headers for linux. What target os do you want?
Hmmmm... I really am out of my depth here! The headers in the download from the other thread are w32 specific aren't they? I actually use linux on most of my pc's, but can use a windows laptop if that'd be more convenient. I'd just like to try and get the arduino board speaking with glbasic on either platform!

Did you look at the C code I'd be trying to integrate using inline? http://todbot.com/arduino/host/arduino-serial/arduino-serial.c

Any advice would be truly welcome! Maybe I'm biting off more than I can chew with next to no C knowledge...

matchy

Well I just got an Arduino clone and tested GLBasic with the serial comms snipet lib for GLBasic and it works fine.  :whistle: :good:

As noted, the comms program is for win32 and unfortunately crashes on Android (portable supply).  :puke:

mentalthink

HI I use Arduino and Glbasic in my free time and Weekends... I don´t know if you comment about programming directly whit GLBasic... but the lenguaje of Arduino it´s very very easy... I comunicate GLbasic whit Arduino simple whit the Serial Port, in the forum qhit a quick search you can find a COM Serial library made by Gernnot...

In example I control whit a WINCE my Arduino , whit a Bluetooth, and you don´t have to do extrange things...

Another point ... If you need a good Ide for Arduino, beause the default Ide it´s very Poor, you have 2 options...
1- Eclipse whit CDT plugin for C++ Code and the Plugin for Arduino, not it´s complex configuring but perhaps you waste a lot of time...
2- This it´s I use now... CODEBLOCK for Arduino, be carefully not it´s the CODEBLOCKS Standard, this come whit a template for Arduino, and a Simulator of the same CHIP, it´s awesoming...

I leave the link here:
http://www.arduinodev.com/codeblocks/

PS_ Take a look to the library COM, it´s a very simple way for talk between Arduino and GLBasic.


Moru

I have also used the coms library from Gernot to successfully communicate with my arduino.

mentalthink

Yes Moru, the simplest way, and you can do anything... whit the powerfull of GLbasic and the power of Arduino, not it´s a toy, very simple and fun, but very powerfull, it´s possible make very interesting things... and well too much cheaper, and Arduino whit Bootloader cost about 5€... only needs the TTL to Serial Cable, for 6E more....

PS: For buy things for Arduino a very nice place it´s Ebay... be carefully whit the seller, but normally I don´t have any trouble, and all it´s more chepaer than another phisical Shops....

matchy

 :rant:  :rant:  :rant:
:rant:  :rant:  :rant:
:rant:  :rant:  :rant:

[attachment deleted by admin]

mentalthink

More Magic Matchy?¿...    :D :D :D , mobile Magic Electronic Magic...