Making an esp32 work as an I2C mouse sensor

Hello

I'm trying to use a esp32 to simulate a mouse sensor. Essentially i opened a mouse and i connected the microcontroller inside (an AT8083) to the esp32 through I2C. The point is to send data to the AT8083 to make it move the cursor on the pc, and i want to control the data with logic on the esp32.
Essentially the same could be done using a Leonardo, i know, but i don't want to do it that way, i have to do it this way.
It appears the connection is made, because when i connect the esp to the AT8083 the cursor starts moving at a constant speed in a perfect 45 degree angle towards the bottom left part of the screen, however i don't really know how to proceed from here.
I don't know what model the sensor is, i have a picture

I tested a couple basic I2C example sketches but still same result.
I tried to do some tests following this datasheet but no luck: https://cdn.sparkfun.com/datasheets/Components/General%20IC/ADNS2620.pdf
any help?
thanks

This sensor appears to be the PAN3101/PAN3102.

Hi thanks for reply
yes it could be, i just saw that the datasheet it lists the compatible sensors, however i still have no idea how exactly to write the code to mimic it

BTW what is "IC2"? May be I2C?

yes I2c. reading the datasheet it seems that first i need to receive a byte from the AT8083, then i have to send a byte with the data from the esp32, however i'm not getting any data at all it seems, here's the sketch:

void receiveEvent(int howMany) {
  while(!Wire.available()) {   }
  uint8_t STdataH = Wire.read();

  Serial.println(STdataH);
}

void setup() {
  Wire.begin(0x38);                // join i2c bus with address 0x38
  Wire.setClock( 18432L);  
  Wire.onReceive(receiveEvent); // register event
  Serial.begin(9600);           // start serial for output
}

void loop() {
  delay(100);
}

That chipis not an i2c device. If you look at the datasheet, there is no START/STOP, just continuous serial. It looks like you might be able to use the SPI functions to communicate. I'm not sure.

Here is a note: https://www.posital.com/media/posital_media/documents/AbsoluteEncoders_Context_Technology_SSI_AppNote.pdf

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.