Hi. My team is working on building a high-power rocket for a college senior design project, and are using Ardupilot Mega 1.4(with 2560 processor) as our microcontroller. We chose to use the Arduino software to program our Ardupilot, and as a starter, we tried to upload one of the sample code 'Blink' to see whether it runs fine. We have already soldered the Ardupilot Mega 1.4 with IMU shield.

 

IMG_4936.jpg

 

Problem is, we uploaded the blink without any error but nothing blinks on the board. We have tried letPin=1 and connect the MUX-OUT1 to external LED but it did not work either. We believe the reason for this malfunction is from trying out wrong pin numbers.

 

Now we are trying to make the on-board LED to blink without connecting an external LED by modifying code. Any help would be great!! Thanks.

 

The following is a sample code for the 'Blink.'

 

======
/* Blinking LED
* ------------
*
* turns on and off a light emitting diode(LED) connected to a digital
* pin, in intervals of 2 seconds. Ideally we use pin 13 on the Arduino
* board because it has a resistor attached to it, needing only an LED

*
* Created 1 June 2005
* copyleft 2005 DojoDave <http://www.0j0.org&gt;
* http://arduino.berlios.de
*
* based on an orginal by H. Barragan for the Wiring i/o board
*/

int ledPin = 13; // LED connected to digital pin 13

void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}

void loop()
{
digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // waits for a second
digitalWrite(ledPin, LOW); // sets the LED off
delay(1000); // waits for a second
}

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • 3D Robotics

    You can't use Arduino sample code on APM. All the APM LEDs are on different pins from the Arduino dev boards. 

This reply was deleted.

Activity