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.
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...
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!
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
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!
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 ;)
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:
#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?
yikes! That's headers for linux. What target os do you want?
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...
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:
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.
I have also used the coms library from Gernot to successfully communicate with my arduino.
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....
:rant: :rant: :rant:
:rant: :rant: :rant:
:rant: :rant: :rant:
[attachment deleted by admin]
More Magic Matchy?¿... :D :D :D , mobile Magic Electronic Magic...
Perhaps something with a dice?! Hmmm...how can I prove to a spectator that a random number is being generated?
Quote from: mentalthink on 2012-Sep-28
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....
Con arruino puedo manejar un motor de corriente alterna? Tiene que ser el arruino original o algún clon barato =D
Hola tatamuker ( inglés, asi no se "rompe" el foro).
Arduino it´s a CPU, you can make a lot of things... but if you want control a AC current engine, you need in example a Relé, this it´s a simple switch controlled whit a magnetic field, when you say , change the swith, the motor beggins and when you want stop it, you don´t send current to Relé.
Another way it´s changing the velocity, in this case, you can make a bit more complex extra circuit... you can add a Tiristor, this it´s like a transistor, but you only leave pass the Ampers what do you want, and then the speed can be regulated, but in example you can connect this motor, from another coutry, connecting Arduino to interner, whit a mobile device, thanks to the COM library you can use bluettoths, or simply, when the sun goes to a LDR(Resistance variable whit light), this can run or not...
Take in mind, it´s a Computer, but only it´s a CPU, but it´s totally factible make a computer form the Scracth, I think this it´s a very complex... but for me it´s a goal I want do...
PS: Si te interesa el tema, mandame un privado y te los explico con más detalle, pero con que te des una vuelta por Yotube o cualquier pagina googleando encuentras un monton de información, se puede hacer aparatos que son realmente caros, como por ejemplo impresoras 3D, por mucho menos de lo que se venden en comercios (Lo bueno es lo sencillo que es programarlo)
A mi SI me interesa... :P