Hi,
I got a problem, once my Flora is powered(USB cable or Lipo battery), the D7 built-in led will be on(slightly blink), while I am sure I don't have "digitalWrite(7,HIGH);" in my sketch. In this case, the serial monitor doesn't work. Maybe you have any idea about this problem?
Thanks.
D7 is always on, Flora
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: D7 is always on, Flora
The LED will "pulse" when the bootloader is running. This will happen for 10 seconds when power is first applied, or when you press the reset button.
If the LED is simply *blinking*, then that is the default blink sketch that is loaded onto the Flora at the factory.
Have you managed to load your own sketch yet? Can you post that sketch? If there's an error in it, possibly, it's causing the Flora to reset.
If the LED is simply *blinking*, then that is the default blink sketch that is loaded onto the Flora at the factory.
Have you managed to load your own sketch yet? Can you post that sketch? If there's an error in it, possibly, it's causing the Flora to reset.
- lanxingshuier
- Posts: 9
- Joined: Wed Sep 03, 2014 4:18 am
Re: D7 is always on, Flora
Hi
Thanks for your reply. While I do have already load my own sketch and the D7 keep blinking.
Can you help to check my sketch maybe? I have contacted a 9dof sensor from Adafruit and a multiplexer to Flora.
Thanks for your reply. While I do have already load my own sketch and the D7 keep blinking.
Can you help to check my sketch maybe? I have contacted a 9dof sensor from Adafruit and a multiplexer to Flora.
Code: Select all
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_LSM9DS0.h>
#include <Adafruit_Sensor.h>
int s0 = 10;
int s1 = 9;
int s2 = 6;
int s3 =12;
Adafruit_LSM9DS0 lsm = Adafruit_LSM9DS0();
void setupSensor()
{
// 1.) Set the accelerometer range
lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_2G);
//lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_4G);
//lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_6G);
//lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_8G);
//lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_16G);
// 2.) Set the magnetometer sensitivity
lsm.setupMag(lsm.LSM9DS0_MAGGAIN_2GAUSS);
//lsm.setupMag(lsm.LSM9DS0_MAGGAIN_4GAUSS);
//lsm.setupMag(lsm.LSM9DS0_MAGGAIN_8GAUSS);
//lsm.setupMag(lsm.LSM9DS0_MAGGAIN_12GAUSS);
// 3.) Setup the gyroscope
lsm.setupGyro(lsm.LSM9DS0_GYROSCALE_245DPS);
//lsm.setupGyro(lsm.LSM9DS0_GYROSCALE_500DPS);
//lsm.setupGyro(lsm.LSM9DS0_GYROSCALE_2000DPS);
}
void setup()
{
pinMode(s0, OUTPUT);
pinMode(s1, OUTPUT);
pinMode(s2, OUTPUT);
pinMode(s3, OUTPUT);
Serial.begin(9600);
digitalWrite(s0, LOW);
digitalWrite(s1, LOW);
digitalWrite(s2, LOW);
digitalWrite(s3, LOW);
delay(200);
while (!Serial); // flora & leonardo
Serial.println("LSM raw read demo");
// Try to initialise and warn if we couldn't detect the chip
if (!lsm.begin())
{
Serial.println("Oops ... unable to initialize the LSM9DS0. Check your wiring!");
while (1);
}
delay(200);
}
void loop()
{
digitalWrite(s0, LOW);
digitalWrite(s1, LOW);
digitalWrite(s2, LOW);
digitalWrite(s3, LOW);
delay(200);
lsm.read();
Serial.print("Accel X: "); Serial.print((int)lsm.accelData.x); Serial.print(" ");
Serial.print("Y: "); Serial.print((int)lsm.accelData.y); Serial.print(" ");
Serial.print("Z: "); Serial.println((int)lsm.accelData.z); Serial.print(" ");
Serial.print("Mag X: "); Serial.print((int)lsm.magData.x); Serial.print(" ");
Serial.print("Y: "); Serial.print((int)lsm.magData.y); Serial.print(" ");
Serial.print("Z: "); Serial.println((int)lsm.magData.z); Serial.print(" ");
Serial.print("Gyro X: "); Serial.print((int)lsm.gyroData.x); Serial.print(" ");
Serial.print("Y: "); Serial.print((int)lsm.gyroData.y); Serial.print(" ");
Serial.print("Z: "); Serial.println((int)lsm.gyroData.z); Serial.println(" ");
Serial.print("Temp: "); Serial.print((int)lsm.temperature); Serial.println(" ");
delay(300);
}
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: D7 is always on, Flora
What do you see in the serial monitor when you run that sketch?
- lanxingshuier
- Posts: 9
- Joined: Wed Sep 03, 2014 4:18 am
Re: D7 is always on, Flora
blank window, do you think D7 is blinking may because of the power is not stable on the Flora board?
- lanxingshuier
- Posts: 9
- Joined: Wed Sep 03, 2014 4:18 am
Re: D7 is always on, Flora
It seems like, I powered the Flora with cable or Lipo battery, 50% chance the D7 is blinking, when it's normal, the sketch will run correctly and I can read data from the Serial window.
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: D7 is always on, Flora
It is possible you have a power problem or something else that is causing the Flora to reset. Try a different USB cable if you have one.
Please be positive and constructive with your questions and comments.