I am hooking up a couple of additional digital lines to AN4 and AN5 as labeled on the IMU. How do I reference them as digital pins from within the code? For example...pinMode(???,OUTPUT);...digitalWrite(???,HIGH);...digitalWrite(???,LOW);What is ???Thanks. Preston.
You need to be a member of diydrones to add comments!
Thanks Knuckle, but I tried using the alias.ssss of AN0-AN5. This works when I write a simple sketch to turn them on, but not when I'm working in the Ardupilot code..
That said, I was able to figure out the answer to my own question. Based on the number of digital pins you normally have on a mega, and adding to that number, I found the following is true.
According the the documentation on the arduino website, you can now reference them by A0, A1, A2...check here . It didnt use to be that way, so maybe make sure youre using a newer arduino ide and maybe try with something cheap like an led and resistor first.
Replies
That said, I was able to figure out the answer to my own question. Based on the number of digital pins you normally have on a mega, and adding to that number, I found the following is true.
Print on AMU - Digital Pin Ref
AN0 - 54
AN1 - 55
AN2 - 56
AN3 - 57
AN4 - 58
AN5 - 59
Maybe someone can add this to the doc.
Preston