mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Fixed formatting in some of the examples
This commit is contained in:
parent
a0d163b8fb
commit
b946a41576
8 changed files with 98 additions and 98 deletions
|
@ -73,7 +73,7 @@ void setup()
|
||||||
|
|
||||||
next_time = millis() + 5000;
|
next_time = millis() + 5000;
|
||||||
|
|
||||||
HidMouse.SetReportParser(0,(HIDReportParser*)&Prs);
|
HidMouse.SetReportParser(0, (HIDReportParser*)&Prs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
|
|
|
@ -35,7 +35,7 @@ void setup()
|
||||||
LCD.begin(16, 2);
|
LCD.begin(16, 2);
|
||||||
LCD.clear();
|
LCD.clear();
|
||||||
LCD.home();
|
LCD.home();
|
||||||
LCD.setCursor(0,0);
|
LCD.setCursor(0, 0);
|
||||||
LCD.write('R');
|
LCD.write('R');
|
||||||
|
|
||||||
delay( 200 );
|
delay( 200 );
|
||||||
|
|
|
@ -16,7 +16,7 @@ USBHub Hub1(&usb);
|
||||||
USBHub Hub2(&usb);
|
USBHub Hub2(&usb);
|
||||||
HIDBoot<USB_HID_PROTOCOL_KEYBOARD> HidKeyboard(&usb);
|
HIDBoot<USB_HID_PROTOCOL_KEYBOARD> HidKeyboard(&usb);
|
||||||
|
|
||||||
ADK adk(&usb,"Circuits@Home, ltd.",
|
ADK adk(&usb, "Circuits@Home, ltd.",
|
||||||
"USBHost Host Shield",
|
"USBHost Host Shield",
|
||||||
"Arduino Terminal for Android",
|
"Arduino Terminal for Android",
|
||||||
"1.0",
|
"1.0",
|
||||||
|
@ -28,7 +28,7 @@ class KbdRptParser : public KeyboardReportParser
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void OnKeyDown (uint8_t mod, uint8_t key);
|
void OnKeyDown(uint8_t mod, uint8_t key);
|
||||||
void OnKeyPressed(uint8_t key);
|
void OnKeyPressed(uint8_t key);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -43,17 +43,17 @@ void KbdRptParser::OnKeyDown(uint8_t mod, uint8_t key)
|
||||||
/* what to do when symbol arrives */
|
/* what to do when symbol arrives */
|
||||||
void KbdRptParser::OnKeyPressed(uint8_t key)
|
void KbdRptParser::OnKeyPressed(uint8_t key)
|
||||||
{
|
{
|
||||||
const char* new_line = "\n";
|
const char* new_line = "\n";
|
||||||
uint8_t rcode;
|
uint8_t rcode;
|
||||||
uint8_t keylcl;
|
uint8_t keylcl;
|
||||||
|
|
||||||
if( adk.isReady() == false ) {
|
if ( adk.isReady() == false ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
keylcl = key;
|
keylcl = key;
|
||||||
|
|
||||||
if( keylcl == 0x13 ) {
|
if ( keylcl == 0x13 ) {
|
||||||
rcode = adk.SndData( strlen( new_line ), (uint8_t *)new_line );
|
rcode = adk.SndData( strlen( new_line ), (uint8_t *)new_line );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -77,7 +77,7 @@ void setup()
|
||||||
|
|
||||||
if (usb.Init() == -1) {
|
if (usb.Init() == -1) {
|
||||||
Serial.println("OSCOKIRQ failed to assert");
|
Serial.println("OSCOKIRQ failed to assert");
|
||||||
while(1); //halt
|
while (1); //halt
|
||||||
}//if (usb.Init() == -1...
|
}//if (usb.Init() == -1...
|
||||||
|
|
||||||
HidKeyboard.SetReportParser(0, (HIDReportParser*)&Prs);
|
HidKeyboard.SetReportParser(0, (HIDReportParser*)&Prs);
|
||||||
|
|
Loading…
Reference in a new issue