Skip to content
Snippets Groups Projects
Commit 89f9edb7 authored by Jean-Christophe BUDA's avatar Jean-Christophe BUDA
Browse files

remove test_usb_device.cpp file not used

parent 5873b030
No related branches found
No related tags found
No related merge requests found
......@@ -480,8 +480,9 @@
<SubType>compile</SubType>
<Link>core\WVariant.h</Link>
</Compile>
<Compile Include="test_usb_device.cpp">
<Compile Include="C:\jcb\support\arduino\ArduinoZero\hardware\arduino\samd\cores\validation\validation_usb_device\test_usb_device.cpp">
<SubType>compile</SubType>
<Link>test_usb_device.cpp</Link>
</Compile>
</ItemGroup>
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
......
/*
Copyright (c) 2012 Arduino. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define ARDUINO_MAIN
#include "Arduino.h"
#ifdef HID_ENABLED
const int buttonPin = 4; // input pin for pushbutton
int previousButtonState = HIGH; // for checking the state of a pushButton
int counter = 0; // button push counter
#endif
void setup(void)
{
USBDevice.init();
USBDevice.attach();
#ifdef HID_ENABLED
Mouse.begin();
// make the pushButton pin an input:
pinMode(buttonPin, INPUT);
// initialize control over the keyboard:
Keyboard.begin();
#endif
#ifdef CDC_ENABLED
SerialUSB.begin(115200);
#endif
}
void loop(void)
{
#ifdef HID_ENABLED
Mouse.move(1, 0, 0);
// read the pushbutton:
int buttonState = digitalRead(buttonPin);
// if the button state has changed, and it's currently pressed:
if ((buttonState != previousButtonState) && (buttonState == HIGH))
{
// increment the button counter
counter++;
// type out a message
Keyboard.print("You pressed the button ");
Keyboard.print(counter);
Keyboard.println(" times.");
}
// save the current button state for comparison next time:
previousButtonState = buttonState;
#endif
#ifdef CDC_ENABLED
if (SerialUSB.available() > 0)
{
char inChar;
while( -1 == (inChar = SerialUSB.read()));
SerialUSB.print(inChar);
}
delay(10);
#endif
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment