USB Host MouseController problem

Hi all please help me

I´m testing USB Host MouseController example - working great ! But when adding some code like ADC read or pin control, that working only when moves mouse !!!!!

This is normal or error in USB Host library ?

Thanks help Kamil

P.S. sorry my bad english

I tried it adding the Blink code and both worked OK. Here the code I tried.

 Mouse Controller Example
 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
 This sample code is part of the public domain.

// Require mouse control library
#include <MouseController.h>

// Initialize USB Controller
USBHost usb;
int led = 13;

// Attach mouse controller to USB
MouseController mouse(usb);

// variables for mouse button states
boolean leftButton = false;
boolean middleButton = false;
boolean rightButton = false;
boolean left;
boolean middle;
boolean right;

// This function intercepts mouse movements
void mouseMoved() {
  Serial.print("Move: ");
  Serial.print(", ");

// This function intercepts mouse movements while a button is pressed
void mouseDragged() {
  Serial.print("DRAG: ");
  Serial.print(", ");

// This function intercepts mouse button press
void mousePressed() {
  Serial.print("Pressed: ");
  if (mouse.getButton(LEFT_BUTTON)){
    leftButton = true;
  if (mouse.getButton(MIDDLE_BUTTON)){
    middleButton = true;
  if (mouse.getButton(RIGHT_BUTTON)){
    rightButton = true;

// This function intercepts mouse button release
void mouseReleased() {
  Serial.print("Released: ");
  if (!mouse.getButton(LEFT_BUTTON) && leftButton==true) {
    leftButton = false;
  if (!mouse.getButton(MIDDLE_BUTTON) && middleButton==true) {
    middleButton = false;
  if (!mouse.getButton(RIGHT_BUTTON) && rightButton==true) {
    rightButton = false;

void setup()
   pinMode(led, OUTPUT);
  Serial.println("Program started");

void loop()
  // Process USB tasks
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW

It could help also if you show us the code you ran that has the problem.

I´m testing your code but not working - same problem. Few first blink working - after few second stoped blinking. When mouse move again few second working.

Arduino IDE v1.5.1r2 WinXP SP3 and Genius USB mouse Net Scroll 120 powering over USB programming port


I have my PC connected to the programming port (same drive) and my mouse to the Native port (Bossac driver).
I noticed that the LOW led status is taking a bit longer (around 2 sec) but still blinking.