Go Down

Topic: Android ADK Blinking example not blinking sometimes (Read 693 times) previous topic - next topic

Oct 05, 2012, 10:26 am Last Edit: Oct 05, 2012, 12:14 pm by vinobigbang Reason: 1
I have arduino uno connected with itead usbshield. I am receiving the data from android phone and it blinks only when i open serial monitor otherwise it is not. How to blink it independently. Is there any way it relates with opening serial monitor...?

I use pin 13 for blinking it...
Please guide me in to this...

This is the code...

Code: [Select]
void loop()
{
 Usb.Task();
 if(adk.isReady()) {
   uint8_t msg[1];
   uint16_t len = sizeof(msg);
   uint8_t rcode = adk.RcvData(&len, msg);
   if(rcode && rcode != hrNAK)
     USBTRACE2("Data rcv. :", rcode);
   if(len > 0) {
     Serial.print(F("\r\nData Packet: "));
     Serial.print(msg[0]);
     digitalWrite(LED,msg[0] ? HIGH : LOW);
   }
 }
 else
   digitalWrite(LED, LOW);
}

Nick Gammon

Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy