According to the DIYdrone website, APM 2.0 should have 12 analog pins. However, when I tested it out, only A0~A8 which corresponds to 54~62 work as analog pins, but the rest 3 pins do not work. I tested this with an airspeed sensor. The following code is what I used for tests. Does anyone know what I am doing wrong?
-------------------------------------------------------------------------------------------------------------------------------------------------
int val1 = 0; // variables to store the value read
void setup()
{
Serial.begin(38400); // setup serial
}
void loop()
{
val1 = analogRead(63); // read the input pin (it varies from pin 54 to 65)
Serial.print("Analog 63: ");
Serial.print(val1); // debug value
Serial.print("\n");
}
Tags: 2.0, APM, Analog, ArduPilotMega, Digital, Pin, Pins, number, of
Permalink Reply by Sunghun Jung on April 25, 2012 at 7:18pm Never mind. Problem solved.
Permalink Reply by Richard Unwin on April 26, 2012 at 1:28am
Permalink Reply by Sunghun Jung on April 26, 2012 at 5:42am You need to solder as shown in Fig1. That's it.
Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.1280 members
16 members
182 members
86 members
51 members
© 2013 Created by Chris Anderson.
Powered by
