Hi everyone!
This is my first time on the forum.
I'm trying to read data from an Accelerometer (ADXL337 3 Axis Accelerometer with Analog Outputs)
while simultaneously blinking an LED.
I have two separate sketches doing both tasks successfull. But when I merged them, the analogRead() function that I use to get data from the Accelerometer started picking up voltage from the blinking LED.
This could be clearly seen in my plot of the dat (Using the Serial Plotter function in the IDE)
The blink function of the LED is controlled throw a switch. I have attached to screenshots of the accelerometer working with the LED blink function OFF(Filename:Normal_ADXL_output) and with the LED blink function ON(Filename:faulty_ADXL_output).
Is there a way to solve this? I tried adding a delay between my analogReads and that did not improve the situation at all.
I also tried reading the same pin twice to see if that would help and it did not.
I believe this is a known issue but I couldn't find much discussion on it or solutions.
Board is an Arduino Uno
LED is on pin 10 and 11
Analog read is done on PINs A0, A1 and A2
Any suggestions are appreciated
PS: It's great to finally join in on the conversation!