Now I understand some people are probably wondering why you would want to use Cocoa instead of Processing, the reason I have is: if you use Cocoa over Processing you can have a full Computer Application(e.g. Safari, Mail, iCal) that can have a physical output. (e.g. Lights, motors, servos)
So Have Fun, Work hard, & Play nice! Please ask any questions you have!
Notes:
- This will only work for Mac OS X & Windows
- The source code is attached below.
- If you don't want to code the app, or you don't have xcode, you can find the app for OS X in the source below under: 'Build -> Debug'
- The instructions for Windows are in step 7
Remove these ads by
Signing UpStep 1Stuff you need:
| « Previous Step | Download PDFView All Steps | Next Step » |













































So I made up a Mac application that can relay strings send from the Internet to a connected serial device and vice versa. I now think I must share because this app is very useful for me. So maybe you'll find that too!
My Arduino is in the post, can't wait to get started.
It looks like its been changed a little since I wrote it, but I wrote up the part on using Popen().
Also, you have to change the part in the code after the tty.usbserial to whatever port your Arduino is on. So you have to look in the Arduino program under Tools/Serial Port then replace the "/dev/tty.usbserial-A6006hmi" thats in this code to the selected serial port in the Arduino program. Read my post for more info about this.
i needed to change the com port to com4 because thats what my arduino uses, and when i press on or off the RX light goes on for a short time but it doesnt trigger...
any ideas?
In your code you used the serial port "/dev/tty.usbserialA6006hmi", but this is dependent on which computer you are using. In my case I had to replace both instances of that with "/dev/tty.usbserialA4001KMJ" (which was the port I had selected in the Arduino IDE) in order for my application to properly send data to my arduino. I suggest to add a step in which you find out which serial port you are using and add it into the code. (Just to prevent any confusion for somebody else reading this instructable)
Other than that great instructable and you have my vote!
Thanks a lot!!
Or is that the subject for a whole Instructable in itself?
"echo i > /dev/tty.usbserial-A6006hmi", "r"
in terminal with the the arduino serial monitor open it will also work. All popen() does it run code in terminal. Here's an article on this topic. I do quite a bit of programming in cocoa, but not much with serial connections. So I'm fairly new to this.