4 // Satisfy IDE, which only needs to see the include statment in the ino.
6 #include <spi4teensy3.h>
13 ADK adk(&Usb,"Circuits@Home, ltd.",
15 "Arduino Terminal for Android",
17 "http://www.circuitsathome.com",
23 #if !defined(__MIPSEL__)
24 while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
26 Serial.println("\r\nADK demo start");
28 if (Usb.Init() == -1) {
29 Serial.println("OSCOKIRQ failed to assert");
31 }//if (Usb.Init() == -1...
37 uint8_t msg[64] = { 0x00 };
38 const char* recv = "Received: ";
42 if( adk.isReady() == false ) {
47 rcode = adk.RcvData(&len, msg);
48 if( rcode & ( rcode != hrNAK )) {
49 USBTRACE2("Data rcv. :", rcode );
52 USBTRACE("\r\nData Packet.");
54 for( uint8_t i = 0; i < len; i++ ) {
55 Serial.print((char)msg[i]);
57 /* sending back what was received */
58 rcode = adk.SndData( strlen( recv ), (uint8_t *)recv );
59 rcode = adk.SndData( strlen(( char * )msg ), msg );