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.

Mac OS Foot Switch from a Guitar Amp Pedal.

Step 9Program the Mac

Program the Mac
So, by now we have a foot switch talking to our Arduino. The Arduino writes a 1 or a 2 to the serial device when we click the switches. We need something on the Mac to read it. Making the Arduino pretend to be a keyboard is kinda hard. So, instead we are gonna write a little C program to be our controller for the Mac.

We'll start by taking Tod E. Kurt's existing arduino-serial program that reads the Arduino serial port. I've made a few small modifications to automatically do stuff when it sees a 1 or a 2. The attached file should work well. You can read the comments if you wanna see whats going on, but its not for the faint of heart.

You can download the source (the arduino-serial-footswitch.c file) or the compiled app (third file: arduino-serial-footswitch).

Download it and put it in a new folder.

If you wanna compile it, I'll assume you know how to:

1) Open an iTerm and CD into that directory
2) Compile it by typing: gcc -o arduino-serial-footswitch arduino-serial-footswitch.c
« 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!
2
Followers
3
Author:aymans
I'm a research scientist at Yahoo! I like making stuff.