Step 6How this works
popen("echo i > /dev/tty.usbserial-A6006hmi", "r");
This code sends the letter i to the Serial port: /dev/tty.usbserial-A6006hmi which is received by the arduino
With in the arduino program there is the code:
For the Arduino to receive the signal from the cocoa app the serial monitor in the Arduino IDE needs to be open.
If this doesn't make sense it's fine. This is kind of a reference if you want to expand the functionality of the program.
| « Previous Step | Download PDFView All Steps | Next Step » |










































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.