Hello,
I just got a pack of 3 Seeduino Xiaos and soldered the pins on and ran the blink program successfully (I am using the Arduino IDE). I am trying to upload a sketch that uses Adafruit’s Neopixel library and a library for the MMA7455 accelerometer paired with the Wire library. I can upload a plain Neopixel library example, but when I try to upload a sketch with the MMA7455 library, it uploads “successfully,” but my Xiao stops connecting to my computer and I can no longer select the port and the code doesn’t run. I am able to upload code if I short the reset pad twice.
I mention the libraries because I think that is what’s causing the problem, but I’ll post the “MMA_7455_Demo” example code for the MMA7455 library. This is the code that freezes the Xiao. (I didn’t see an option for specific code tags so please let me know if I pasted that code wrong). Thanks!
MMA_7455 library download link
#include <Wire.h> //Include the Wire library
#include <MMA_7455.h> //Include the MMA_7455 library
MMA_7455 accel = MMA_7455(); // Make MMA7455 object
char xVal, yVal, zVal; // Return value variables
void setup() {
Serial.begin(9600); // Use the Serial Monitor window at 9600 baud
// Set the g force sensitivity: 2=2g, 4=4g, 8-8g
accel.initSensitivity(2);
// Provide oiffset values so that sensor displays 0, 0, 63
// (or close to it) when positioned on a flat surface, all pins
// facing down
// Update the numbers with your own values from the MMA7455_CalibrateOffset sketch.
accel.calibrateOffset(0, 0, 0);
}
void loop() {
// Get the X, Y, anx Z axis values from the device
xVal = accel.readAxis(‘x’); // Read X Axis
yVal = accel.readAxis(‘y’); // Read Y Axis
zVal = accel.readAxis(‘z’); // Read Z Axis
// Display them in the Serial Monitor window.
Serial.print("X: = “);
Serial.print(xVal, DEC);
Serial.print(” Y: = “);
Serial.print(yVal, DEC);
Serial.print(” Z: = ");
Serial.println(zVal, DEC);
delay(1000);
}