' USB Advisor: You may wish to initialize some things here, before 
' the USB initialization happens.  Initialization code placed here 
' is sure to run, even if the USB initialization fails (perhaps 
' because the device was never connected to a USB cable).
' For example:
' The following 5 lines initialize real I/O on a Pic Proto USB board
' 	INTCON2.7 = 0   	' Enable PortB Pullups
' 	TRISB = %11111100	' PORTB to all inputs except LED1 and LED2
'  	TRISA = %11111111	' PORTA to all inputs, esp POT1 and POT2
'  	ADCON0 = 0
'  	ADCON1 = %00001101	' Only A/D channels 0 and 1 are enabled TRISD = 0 		'FRED ADDED THIS LINE
'******************************************************************
DoHandleEp1Rcv:
  	HandleEp1Rcv = TRUE ' Indicate that we have data to handle
' --------------- ADD USER "EP1 RCV" CODE HERE: ------------------
' Add code here to handle the newly received data from Endpoint 1 ' Out Widget_Interface_0
' USB Advisor: Here is where you add code to make use of the data ' that has arrived from the PC.
' For example:
' The following two lines provide real I/O for a PicProto USB board
'  	realLED1 = LED1 ' Light the LEDs
'  	realLED2 = LED2
PORTD = widget_outputdata 'FRED ADDED THIS LINE
' --------------- END USER "EP1 RCV" CODE: ------------------
  	HandleEp1Rcv = FALSE   
' Indicate that received EP1 data has been handled now
ExitEp1Rcv:
Listing 3—Note that even the comments reflect the values entered in the HIDmaker FS visual data designer. This is where you add the bulk of your application functionality on the USB peripheral side of the link.