Step 2Coding the app
Note: If you don't want to code the app, or you don't have xcode, you can find the app in the source code download under: 'Build -> Debug'
Create the project:
1) Open Xcode
2) Press 'Command + shift + n' This will open the new project dialog
3) Select 'Cocoa Application' under "Mac OS X -> Applications" Press Next
4) Call the app what you want. I'm calling mine "Arduino Controller"
Add your class:
5) Once the project is created, Press 'Command + n'
6) Select the Objective-C Class option from the Classes option under the Mac OS X section
7) Call it MainController. Then press finish
Add the code:
8) Open MainController.h
9) After the '}' & before the '@end' add the code:
-(IBAction)ledOn:(id)sender;
-(IBAction)ledOff:(id)sender;
11) After the code ''@implementation MainController" & before the '@end' add the code:
-(IBAction)ledOn:(id)sender{
popen("echo i > /dev/tty.usbserial-A6006hmi", "r");
}
-(IBAction)ledOff:(id)sender{
popen("echo o > /dev/tty.usbserial-A6006hmi", "r");
}
Finishing The Coding:
13) Double click on MainWindow.xib. It is located under Resources
14) Interface Builder will open
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|






























































