problem using MPU-6050 Accel/Gyro with ESP32
Re: problem using MPU-6050 Accel/Gyrp with ESP32
I forgot to mention that I used the same MPU6050 Library by Electronic Cats that I started with
Re: problem using MPU-6050 Accel/Gyrp with ESP32
After a lot of testing I was able to figure it out. The issue was not with the code the problem was the pin used.
In addition the code to configure a pin as an interrupt is working.
The data found on the internet for the Heltec WiFi32 board is misleading because some features of this board operate differently from the other ESP32 boards.
For example some docs I found say that any pin can on an ESP32 board can be configured as an interrupt. But on the Heltec board not all pins actually work. Maybe there is extra coding or whatever.
I tested most of the pins on the Heltec board and results are as follows
(Pin numbers are based on the Heltec pinout previiusly provided)
36, 37, 38, 39 - SEE NOTE
34 - NG
35 - NG
32 - OK
33 - OK
19 - OK
18 - OK
5 - OK
2 - OK
36, 37, 38, 39 exhibited strange behavior. They did work when configured as an interrupt but they activated in pairs.
For example if I configured Pin 37 as an interrupt Pin 36 also triggered an interrupt. Same condition for Pair 38 & 39.
The code snipets for the MPU6050 interrupt are as follows (dmpDataReady is interrupt routine)
#define INTERRUPT_PIN 39
void setup() {
pinMode(INTERRUPT_PIN, INPUT);
attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), dmpDataReady, RISING);
}
Now I need to work this conde into my GPS Data Logger.
Question: The uBlox GPS Module uses two pins for data TX and RX. If the MPU6050 Accel/Gyro generates an interrupt will it cause issues with the sketch dropping GPS Data?
In addition the code to configure a pin as an interrupt is working.
The data found on the internet for the Heltec WiFi32 board is misleading because some features of this board operate differently from the other ESP32 boards.
For example some docs I found say that any pin can on an ESP32 board can be configured as an interrupt. But on the Heltec board not all pins actually work. Maybe there is extra coding or whatever.
I tested most of the pins on the Heltec board and results are as follows
(Pin numbers are based on the Heltec pinout previiusly provided)
36, 37, 38, 39 - SEE NOTE
34 - NG
35 - NG
32 - OK
33 - OK
19 - OK
18 - OK
5 - OK
2 - OK
36, 37, 38, 39 exhibited strange behavior. They did work when configured as an interrupt but they activated in pairs.
For example if I configured Pin 37 as an interrupt Pin 36 also triggered an interrupt. Same condition for Pair 38 & 39.
The code snipets for the MPU6050 interrupt are as follows (dmpDataReady is interrupt routine)
#define INTERRUPT_PIN 39
void setup() {
pinMode(INTERRUPT_PIN, INPUT);
attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), dmpDataReady, RISING);
}
Now I need to work this conde into my GPS Data Logger.
Question: The uBlox GPS Module uses two pins for data TX and RX. If the MPU6050 Accel/Gyro generates an interrupt will it cause issues with the sketch dropping GPS Data?
Who is online
Users browsing this forum: No registered users and 84 guests