Hi all,
I am using the SparkFun Redboard Qwiic with the Olimex ECG/EMG shield to collect ECG and EMG data. The problem is that for EMG and ECG data it saturates at 1024 bits. I guess that is because of the shield sending out 0-5V data whereas the RedBoard reads 0-3.3V. I have read that the RedBoard can read 3.3-5V inputs, but I am not sure what the default is and how I can change it to 5V. Or if that is even possible.
Please let me know, what I could do.
This is the code that I am using, if it is of value for this post:
#include <compat/deprecated.h>
#include <FlexiTimer2.h>
#define SAMPFREQ 256 // ADC sampling rate 256
#define TIMER2VAL (1024/(SAMPFREQ)) // Set 256Hz sampling frequency
volatile unsigned char CurrentCh=0; //Current channel being sampled.
volatile unsigned int ADC_Value = 0; //ADC current value
void setup() {
noInterrupts(); // Disable all interrupts before initialization
FlexiTimer2::set(TIMER2VAL, Timer2_Overflow_ISR);
FlexiTimer2::start();
// Serial Port
Serial.begin(57600);
interrupts(); // Enable all interrupts after initialization has been completed
}
void Timer2_Overflow_ISR()
{
ADC_Value = analogRead(CurrentCh);
//Serial.print("D!"); //this is packet header for my application
Serial.print(millis());
Serial.print(", ");
Serial.println(ADC_Value);
}
void loop() {
__asm__ __volatile__ ("sleep");
}
Cheers,
Patrick