Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
I am just learning about Classes, Objects and Methods in my book but I wanted to ask about the steps involved to reach my final goal for my project.

Friday I got all the test parts to control a DC motor with my Mac using Zterm. I plugged it all together and opened Zterm and sent a command '/1P1000R' After that I watched it spin 1000 times and stop.

My goal is to make a program in Objective-C and use a GUI slider up and down to move the DC servo motor. The motor came with the software drivers, IC board, USB cable and zTerm saw it right away. Also the motor is not a basic RC car motor it was around $80 with about 8 wires that connected to the IC board.

I guess my question is, is this a hard things to create with programing and what parts in the book should I pay more attention to to better understand this? Can I access the drivers that I installed on my MAC and send the ASCI commands?

Thanks for helping me understand!

-Lars
 

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
Thanks for your response Lee, I Thought my question was way out there but what they were doing was very close to what I was doing, reason I am learning Objective C. In the end I would like to remove the USB cable and have Bluetooth for a wireless connection.

Thanks for the help.

-Lars
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
The good news (I suppose) is once you get to bluetooth there is an IOBluetooth framework for dealing with it, which seems more straight-forward than serial.

-Lee
 

Sayer

macrumors 6502a
Jan 4, 2002
981
0
Austin, TX
Maybe you should break the project down into a series of milestones:

1. Working GUI that links your selected UI elements to code. Use NSLog() to print some messages to the Console to see if the controls are linked and the app responds like you expect (we call this print-lining and is a very basic form of debugging/testing).

2. Manipulating the GUI triggers methods in code to perform actions you want using "empty" classes that just dump raw commands you want to send to the motor controller to NSLog() instead. Design your app using the Model-View-Controller paradigm.

2b. Figure out how to communicate with serial ports (theres bound to be sample code, ask Google).

3. Wrap the low-level serial port stuff with your custom controller classes.

3b. Abstract your code to separate actual IOKit stuff so you can swap in BlueTooth later.​

This way you have a clear path to follow, you aren't overreaching and you won't try to do things out of order and get frustrated/confused. College time management class FTW!
 

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
Wow, thanks guys. a wealth of knowledge. This is the reason that I am learning Objective C. in 6 months if it is still above my skill level or very confusing I might just hire someone to keep the project on schedule.

I wonder what that would cost me ????


Thanks again, you guys are a great help!

-Lars
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.