3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Controlling an Arduino with Cocoa (Mac OS X) or C# (Windows)

Step 2Coding the app

Coding the app
«
  • Picture 1.png
  • Picture 5.png
  • Picture 6.png
  • Picture 7.png
  • Picture 8.png
  • Picture 10.png
  • Picture 11.png
  • Picture 12.png
  • Picture 13.png
  • Picture 15.png
  • Picture 16.png
  • Picture 17.png
  • Picture 18.png
  • Picture 20.png
  • Picture 21.png
  • Picture 22.png
  • Picture 24.png
  • Picture 25.png
  • Picture 28.png
  • last photo ←
»
Hopefully this makes sense. If you need help please ask any questions you have.
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;
 

 10) Open MainController.m
 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:

12) Press 'Command + b' & press save all
13) Double click on MainWindow.xib. It is located under Resources

14) Interface Builder will open

« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
43
Followers
15
Author:computergeek