]> git.gir.st - tmk_keyboard.git/blob - protocol/usb_hid/USB_Host_Shield_2.0/examples/adk/term_time/term_time.ino
Squashed 'tmk_core/' changes from caca2c0..dc0e46e
[tmk_keyboard.git] / protocol / usb_hid / USB_Host_Shield_2.0 / examples / adk / term_time / term_time.ino
1 #include <adk.h>
2 #include <usbhub.h>
3
4 // Satisfy IDE, which only needs to see the include statment in the ino.
5 #ifdef dobogusinclude
6 #include <spi4teensy3.h>
7 #include <SPI.h>
8 #endif
9
10 USB Usb;
11
12 ADK adk(&Usb,"Circuits@Home, ltd.",
13 "USB Host Shield",
14 "Arduino Terminal for Android",
15 "1.0",
16 "http://www.circuitsathome.com",
17 "0000000000000001");
18
19 void setup()
20 {
21 Serial.begin(115200);
22 #if !defined(__MIPSEL__)
23 while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
24 #endif
25 Serial.println("\r\nADK demo start");
26
27 if (Usb.Init() == -1) {
28 Serial.println("OSCOKIRQ failed to assert");
29 while(1); //halt
30 }//if (Usb.Init() == -1...
31 }
32
33 void loop()
34 {
35 uint8_t buf[ 12 ] = { 0 }; //buffer to convert unsigned long to ASCII
36 const char* sec_ela = " seconds elapsed\r";
37 uint8_t rcode;
38
39 Usb.Task();
40 if( adk.isReady() == false ) {
41 return;
42 }
43
44 ultoa( millis()/1000, (char *)buf, 10 );
45
46 rcode = adk.SndData( strlen((char *)buf), buf );
47 rcode = adk.SndData( strlen( sec_ela), (uint8_t *)sec_ela );
48
49 delay( 1000 );
50 }
Imprint / Impressum