cbrulak
cbrulak

Reputation: 15639

ADK blink tutorial: on board LED is always on

I have a Duemilanove and ADK and I followed this and with the exception of some SDK updates, I followed it exactly.

Problem: the onboard LED doesn't blink but is always on.

Issues:

So, what is wrong? Is it possible that the ADK board is always sending a HIGH signal to the on board LED and I need to use an 'external' LED for testing? A lot of the tutorials I've seen do this so could that be why?

Upvotes: 1

Views: 1293

Answers (3)

digitalhack
digitalhack

Reputation: 446

I haven't used the shield you are using but it looks like it uses SPI for communication. SPI uses pin 13 for the serial clock signal (SCK). Given this I would expect the SCK signal may be interfering with you trying to control the LED.

I would suggest trying to wire an LED to a different digital pin such as pin 8 and update the Arduino sketch to use pin 8. This would remove the possibility of conflict.

Upvotes: 1

Matthew Murdoch
Matthew Murdoch

Reputation: 31483

The onboard Arduino LED is on initially. It looks like it is never being turned off.

In the linked instructions, under the section How To Receive Data From The Android Device , the first line of the loop() function is:

byte msg[0];

Then to receieve data in the call to AndroidAccessory.read() the value sizeof(msg) is used to determine how many bytes to read.

However, because msg was defined to be 0 bytes long, no bytes will be read, len will be zero and the LED will not be updated.

Instead, try changing the line to:

byte msg[1];

Upvotes: 1

Sudar
Sudar

Reputation: 20020

Try to write a small blink program, just to check that everything is alright in your ADK board.

Upvotes: 1

Related Questions