3
Copyright (C) Dean Camera, 2012.
5
dean [at] fourwalledcubicle [dot] com
5
Based on a serial device demonstration from the LUFA project
6
(www.lufa-lib.org). LUFA is Copyright (C) Dean Camera, 2012.
8
Changes made to the serial device demonstration program are
9
Copyright (C) Tim Marston, 2012.
100
fputs( "press\r\n", &USBSerialStream );
109
fprintf( &USBSerialStream, "%lu\r\n", millis() );
110
// fputs( "press\r\n", &USBSerialStream );
158
/** Checks for changes in the position of the board joystick, sending strings to the host upon each change. */
160
void CheckJoystickMovement(void)
162
uint8_t JoyStatus_LCL = Joystick_GetStatus();
163
char* ReportString = NULL;
164
static bool ActionSent = false;
166
if (JoyStatus_LCL & JOY_UP)
167
ReportString = "Joystick Up\r\n";
168
else if (JoyStatus_LCL & JOY_DOWN)
169
ReportString = "Joystick Down\r\n";
170
else if (JoyStatus_LCL & JOY_LEFT)
171
ReportString = "Joystick Left\r\n";
172
else if (JoyStatus_LCL & JOY_RIGHT)
173
ReportString = "Joystick Right\r\n";
174
else if (JoyStatus_LCL & JOY_PRESS)
175
ReportString = "Joystick Pressed\r\n";
179
if ((ReportString != NULL) && (ActionSent == false))
183
/* Write the string to the virtual COM port via the created character stream */
184
fputs(ReportString, &USBSerialStream);
186
/* Alternatively, without the stream: */
187
// CDC_Device_SendString(&VirtualSerial_CDC_Interface, ReportString);
168
// set up arduino wiring.c
192
172
/** Event handler for the library USB Connection event. */
193
173
void EVENT_USB_Device_Connect(void)