Hey all, I was thinking of getting myself an APM 2 Chip (when they restock) but I was really hoping I could experiment with programming it (from scratch) from a variety of applications (boats, rovers, planes, etc).  I'm not the kind of person who is satisfied using a system like this without knowing all of its inner workings.  However, I thought it would be a better (and cheaper) alternative than buying all the components separately and hooking them up with my arduino uno. 

I have a question though.  I've tried wading through the arduplane code, but I can't seem to answer it for myself.

Is the I/O the same on the APM as on the uno?  As in, do analogWrite/Read() and digitalWrite/Read() work like they do on the uno?  I was hoping to use the same libraries to control servos/GPS as on the arduino playground website but the fact that there is a multiplexer makes me worry about compatibility.

If they do work the same, is there a pin map somewhere (somewhere to check which pin to point the gps library to for example).  And if they don't is there a library that can be used to make the APM behave like the uno?

From what I can see, it looks like a fantastic system, I'm just not sure if it is as programmer friendly as the original arduino system.

Tags: analogread, analogwrite, arduino, compatability, i/o, uno

Views: 255

Reply to This

Replies to This Discussion

It's less like the Uno and more like the Atmega 2560 (in fact when you compile using the arduino ide, that's the board type that you must select).  So it's got a lot more pins than the uno which is good although it does make it a bit more complicated.

All (or most) of the pin numbers are actually written on the bottom of the board.

My guess is that you can use the same code for manipulating servos and GPS but you'll need to change some pin mappings in the code...and you probably already guessed this.

Thanks Randy,

     It does make sense being that they use the same chip.  I took another look into the servo I/o code and it looks like you can directly address the output pins, but the input is all taken from one pin (48).  Past that it goes way over my head with a whole lot of registry and interrupt stuff.  I'll keep looking at the code, and maybe by the time its back in stock, I'll have figured it all out.

Scott

RSS

© 2014   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service