I'm trying to use the following PMW3389 mouse sensor library with xiao seeed nrf52840, but initialization fails.
It doesn't seem to recognize SS pin 7, what's the problem?
#include <PMW3389.h>
#define SS 7 // Slave Select pin. Connect this to SS on the module.
PMW3389 sensor;
void setup() {
Serial.begin(9600);
while(!Serial);
//sensor.begin(10, 1600); // to set CPI (Count per Inch), pass it as the second parameter
if(sensor.begin(SS)) // 10 is the pin connected to SS of the module.
Serial.println("Sensor initialization successed");
else
Serial.println("Sensor initialization failed");
//sensor.setCPI(1600); // or, you can set CPI later by calling setCPI();
}
void loop() {
PMW3389_DATA data = sensor.readBurst();
if(data.isOnSurface && data.isMotion)
{
Serial.print(data.dx);
Serial.print("\t");
Serial.print(data.dy);
Serial.println();
}
delay(10);
}