This is Arduino USB Composite example:
#include "Keyboard.h"
void setup()
{
Serial.begin(9600);
Keyboard.begin();
}
void loop()
{
if (Serial.available() > 0)
{
char inChar = Serial.read();
Keyboard.write(inChar + 1);
}
}
and this is Atmels example:
#include "atmel_start.h"
#include "atmel_start_pins.h"
#define CDC_EN (CONF_USB_COMPOSITE_CDC_ECHO_DEMO && CONF_USB_COMPOSITE_CDC_ACM_EN)
#define MOUSE_EN (CONF_USB_COMPOSITE_HID_MOUSE_DEMO && CONF_USB_COMPOSITE_HID_MOUSE_EN)
#define KEYBOARD_EN (CONF_USB_COMPOSITE_HID_KEYBOARD_DEMO && CONF_USB_COMPOSITE_HID_KEYBOARD_EN)
#define MSC_EN (CONF_USB_COMPOSITE_MSC_LUN_DEMO && CONF_USB_COMPOSITE_MSC_EN)
#if CDC_EN
static uint32_t cdc_demo_buf[64 / 4];
#endif
#if MSC_EN
#if CONF_USB_MSC_LUN0_ENABLE
static uint32_t msc_ramdisk_buf[CONF_USB_MSC_LUN0_CAPACITY * 1024 / 4];
#define msc_ramdisk_buf NULL
#endif
#if CONF_USB_MSC_LUN1_ENABLE
static uint32_t msc_diskcache_buf[CONF_USB_MSC_LUN_BUF_SECTORS * 512 / 4];
#define msc_diskcache_buf NULL
#endif
#endif
int main(void)
{
atmel_start_init();
/* Do function or app specific initialize */
#if CDC_EN
cdcdf_acm_demo_init((uint8_t *)cdc_demo_buf);
#endif
#if KEYBOARD_EN || MOUSE_EN
hiddf_demo_init(BUTTON1, BUTTON2, BUTTON3);
#endif
#if MSC_EN
mscdf_demo_init((uint8_t *)msc_ramdisk_buf, (uint8_t *)msc_diskcache_buf);
#endif
/* Start the composite device */
composite_device_start();
/* Main loop */
while (1) {
#if MSC_EN
mscdf_demo_task();
#endif
}
}
What I'm suppose to do with this crap? Where is " Keyboard.write(); " and " Serial.println(); " equivalents?
Anyway, back to the topic, I need to solve Reset and board issues...