mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Run new astyle formatter against all the examples
This commit is contained in:
@ -2,11 +2,11 @@
|
||||
|
||||
ADK Terminal Test
|
||||
|
||||
This demonstrates USB Host connectivity between an
|
||||
This demonstrates USB Host connectivity between an
|
||||
Android phone and an Arduino Due.
|
||||
|
||||
The ADK for the Arduino Due is a work in progress
|
||||
For additional information on the Arduino ADK visit
|
||||
For additional information on the Arduino ADK visit
|
||||
http://labs.arduino.cc/ADK/Index
|
||||
|
||||
created 27 June 2012
|
||||
@ -29,42 +29,42 @@ char serialNumber[] = "1";
|
||||
char url[] = "http://labs.arduino.cc/uploads/ADK/ArduinoTerminal/ThibaultTerminal_ICS_0001.apk";
|
||||
|
||||
USBHost Usb;
|
||||
ADK adk(&Usb, companyName, applicationName, accessoryName,versionNumber,url,serialNumber);
|
||||
ADK adk(&Usb, companyName, applicationName, accessoryName, versionNumber, url, serialNumber);
|
||||
|
||||
void setup()
|
||||
{
|
||||
cpu_irq_enable();
|
||||
printf("\r\nADK demo start\r\n");
|
||||
delay(200);
|
||||
cpu_irq_enable();
|
||||
printf("\r\nADK demo start\r\n");
|
||||
delay(200);
|
||||
}
|
||||
|
||||
#define RCVSIZE 128
|
||||
|
||||
void loop()
|
||||
{
|
||||
uint8_t buf[RCVSIZE];
|
||||
uint32_t nbread = 0;
|
||||
char helloworld[] = "Hello World!\r\n";
|
||||
uint8_t buf[RCVSIZE];
|
||||
uint32_t nbread = 0;
|
||||
char helloworld[] = "Hello World!\r\n";
|
||||
|
||||
Usb.Task();
|
||||
Usb.Task();
|
||||
|
||||
if (adk.isReady())
|
||||
{
|
||||
/* Write hello string to ADK */
|
||||
adk.write(strlen(helloworld), (uint8_t *)helloworld);
|
||||
if (adk.isReady())
|
||||
{
|
||||
/* Write hello string to ADK */
|
||||
adk.write(strlen(helloworld), (uint8_t *)helloworld);
|
||||
|
||||
delay(1000);
|
||||
delay(1000);
|
||||
|
||||
/* Read data from ADK and print to UART */
|
||||
adk.read(&nbread, RCVSIZE, buf);
|
||||
if (nbread > 0)
|
||||
{
|
||||
printf("RCV: ");
|
||||
for (uint32_t i = 0; i < nbread; ++i)
|
||||
{
|
||||
printf("%c", (char)buf[i]);
|
||||
}
|
||||
printf("\r\n");
|
||||
}
|
||||
}
|
||||
/* Read data from ADK and print to UART */
|
||||
adk.read(&nbread, RCVSIZE, buf);
|
||||
if (nbread > 0)
|
||||
{
|
||||
printf("RCV: ");
|
||||
for (uint32_t i = 0; i < nbread; ++i)
|
||||
{
|
||||
printf("%c", (char)buf[i]);
|
||||
}
|
||||
printf("\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
/*
|
||||
Keyboard Controller Example
|
||||
|
||||
Shows the output of a USB Keyboard connected to
|
||||
|
||||
Shows the output of a USB Keyboard connected to
|
||||
the Native USB port on an Arduino Due Board.
|
||||
|
||||
|
||||
created 8 Oct 2012
|
||||
by Cristian Maglie
|
||||
|
||||
|
||||
http://arduino.cc/en/Tutorial/KeyboardController
|
||||
|
||||
|
||||
This sample code is part of the public domain.
|
||||
*/
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
/*
|
||||
Mouse Controller Example
|
||||
|
||||
Shows the output of a USB Mouse connected to
|
||||
|
||||
Shows the output of a USB Mouse connected to
|
||||
the Native USB port on an Arduino Due Board.
|
||||
|
||||
|
||||
created 8 Oct 2012
|
||||
by Cristian Maglie
|
||||
|
||||
|
||||
http://arduino.cc/en/Tutorial/MouseController
|
||||
|
||||
|
||||
This sample code is part of the public domain.
|
||||
*/
|
||||
|
||||
@ -45,15 +45,15 @@ void mouseDragged() {
|
||||
// This function intercepts mouse button press
|
||||
void mousePressed() {
|
||||
Serial.print("Pressed: ");
|
||||
if (mouse.getButton(LEFT_BUTTON)){
|
||||
if (mouse.getButton(LEFT_BUTTON)) {
|
||||
Serial.print("L");
|
||||
leftButton = true;
|
||||
}
|
||||
if (mouse.getButton(MIDDLE_BUTTON)){
|
||||
if (mouse.getButton(MIDDLE_BUTTON)) {
|
||||
Serial.print("M");
|
||||
middleButton = true;
|
||||
}
|
||||
if (mouse.getButton(RIGHT_BUTTON)){
|
||||
if (mouse.getButton(RIGHT_BUTTON)) {
|
||||
Serial.print("R");
|
||||
Serial.println();
|
||||
rightButton = true;
|
||||
|
Reference in New Issue
Block a user