questions on interfacing with Real Basic on os X

Hello, I am new to the ardino but I have lots of great ideas. I know how to turn on and off an led at any pin but I want to take that a step further. I'm a novice programer. I'm running Mac OS X 10.4.7 on a powerbook g4. I want to be able to run real basic and push a button in a GUI program to turn on or off an output or vice versa to light a field on real basic. Basically i want ot add GUI capabities on a simple on off scale for my purpose. I want to eventully make a monitoring and relay control system for my fish tank with this. So is there an really simple Real basic turtorials out there for the Arduino? Thanks in advance.

hello

I use realbasic talking to arduino in a couple of products (for example id-shop rf id monamour)
I should extract some code and paste it on the playground but it will take me ages... in the meantime use the example called "serial_read_basic" that you find in arduino already.

Whenever you send an H it will turn on the LED... you can use this as a strarting point.

one the realbasic side you could use code like this (this is very rough now)

given that you have an object called serial1 on your window

Serial1.SerialPort=System.SerialPort("/dev/usbserial-3B1")
If Serial1.Open then
 Serial1.Write("H")
Else
  MsgBox "The serial port could not be opened."
End if

this code opens the communication port and talks to arduino.
sending an H

check the help in realbasic and you'll find all the info you need

be ready to write an article for the playground about your experiments :wink:

massimo

thank you for the example. If i could ask one more question about it which output will go high by sending and "H" to the serial port? Do i need to also upload code to the board via the Arudino software? Sorry for all the questions like i said i am an amature at programing.

OK here is where i'm at on this progress. I can send an 'H' from a serial terminal and the LED lights great on pin 13. But when i put your example code into RealBasic 5 for Macintosh on a PPC G4 laptop running 10.4.7 it will not work. I get this error message "This Method requires fewr parameters than were passed." and I have no idea what that means or how to fix it.

hmm

the code I posted works on realbasic2006... I've never used realbasic 5.

have you ever programmaed in realbasic before? because if you havent and you need to learn maybe you should try "processing"
it's an opensource language that we use a lot and you can find a lot of examples on how to interface arduino with it.

I have looked at the "processing" language it is not robust enought for me to build a stand alone application out of in the long run. In the short term I use a program called ZTerm to talk back and forth with my program and made the Arduino board a councel app with inputs and outputs. I thank you for your time and help. If you could send me a copy of generic source code that you use inReal Basic with a simple one button operation say when i press the button it sends an "H" to the Arduino board that would be great. I could greatly learn from it. Sadly I haven't used real basic for almost 2 years so I'm sure the problem is in me forgetting a small detail. My email is miked13@mac.com Thank you very much.

I broke down and downloaded REALBaisc 2006 rev 3 today and with slight modification your code worked for me. Now i'm debating if the 350 bucks is worth it for me to buy a full pro copy up. Now my next step is to get this to work using xcode with a c++. What my goal was is to made a test program where you could test every output and every input on the board with a program. I'll be more then happy to share the program with everone on here once it is done and working.

i do all my work with the non-pro version... it's 99dollars I think

thanks for the compliments :slight_smile: