Hello I tried to use mma7455 vibration sensor which connected with arduino Uno wifi rev2 to detect the vibration. However the results always 0 like this:
Hi. The problem is that, unlike the Uno, which has the I2C bus on pins A4/A5 as well as the SDA/SCL pins, on the Uno WiFi Rev2 the I2C bus is only available on the pins marked SCA and SCL. So move your MMA7455 connections from pins A4 and A5 to pins SCA and SCL and the problem should be solved.
// Initialize the MMA7455, and set the offset.
error = MMA7455_init();
if (error == 0)
Serial.println("The MMA7455 is okay");
else
Serial.println("Check your wiring !");
So I would expect your code to contain either the text "The MMA7455 is okay", or "Check your wiring !", but it doesn't contain this text. Why is that? Did you modify the code?