Hobbytronics Mouse host IC

Anyone used one of these Hobbytronics Mouse host IC's?


I have it connected to my serial port, but cannot get anything useable from it.

I don't really want to use I2C, as I don't have enough space left to load that library.
They don't have a demo code for Serial.

I don't really understand how to decode the data from a comma delimited data stream. I am using the following and I am sure that might be the problem:

    if (Serial2.available() > 0) {
          NewMouseX=Serial2.read();                                                  // Get the mouse data
          Serial.print("X: ");Serial.println(NewMouseX);
          Serial.print("Y: ");Serial.println(NewMouseY);
          Serial.print("L: ");Serial.println(LeftButton);
          Serial.print("R: ");Serial.println(RightButton);
          Serial.print("M: ");Serial.println(ScrollButton);
          Serial.println("   ");

It says you can program the baud rate, screen size, mouse starting point etc. I do this in setup.

Not sure how that works either. I assumed you send a sequence of data as follows, but I am sure this is wrong as well. Can you send a value of 5000?

Serial2.write(3);                                                                             // Set Serial Port Baud Rate (default 9600) [2400|4800|9600|14400|19200|38400|57600|115200]
  Serial2.write(5000);                                                                          // Set X Scale width for virtual screen
  Serial2.write(5000);                                                                          // Set Y Scale height for virtual screen
  Serial2.write(2500);                                                                          // Set X starting position on virtual screen
  Serial2.write(2500);                                                                          // Set Y starting position on virtual screen
  Serial2.write(10);                                                                            // Set Mouse sensitivity for virtual screen - default 10
  Serial2.write(1);                                                                             // Change whether settings set using I2C are stored in eeprom - default OFF   [ON|OFF]
  Serial2.write(41);                                                                            // Set I2C Address

I don't have any 'code' to speak of yet. Just me playing around with snippets to try and get this working, before I add it to my main program.

Just some pointers to my obvious errors would be great.

Start with Robin2’s serial input basics. Work your way to the sketch which gets multiple characters and print the entire received data string unaltered on the serial monitor - just so you can see what you're working with.