- Thu May 21, 2015 3:55 am
#182124
Hey people,
I have been attempting to get a muscle sensor kit from sparkfun working(https://www.sparkfun.com/products/13027). However after hooking everything up and running the code provided on the website it seems to return random noise in the serial monitor - the values varying from 200 to 500, whether the muscles sensor are connected or not. It seems the code provided on the website doesn't actually correlate with the suggested setup.
I was wondering if anyone else has had similar experiences or if anyone could suggest a way to write a code that would allow me to read the sensors inputs in the serial monitor?
Here is my setup:
This is the code on the muscle sensor page:
Cheers,
Adam.
I have been attempting to get a muscle sensor kit from sparkfun working(https://www.sparkfun.com/products/13027). However after hooking everything up and running the code provided on the website it seems to return random noise in the serial monitor - the values varying from 200 to 500, whether the muscles sensor are connected or not. It seems the code provided on the website doesn't actually correlate with the suggested setup.
I was wondering if anyone else has had similar experiences or if anyone could suggest a way to write a code that would allow me to read the sensors inputs in the serial monitor?
Here is my setup:
This is the code on the muscle sensor page:
Code: Select all
// reads analog input from the five inputs from your arduino board
// and sends it out via serial
// variables for input pins and
int analogInput[6];
// variable to store the value
int value[6];
void setup()
{
// declaration of pin modes
for(int i=0;i<6;i++)
{
analogInput[i] = i+1;
value[i] = 0;
pinMode(analogInput[i], INPUT);
}
// begin sending over serial port
Serial.begin(9600);
}
void loop()
{
// read the value on analog input
for(int i=0;i<6;i++)
{
value[i] = analogRead(analogInput[i]);
}
// print out value over the serial port
for(int i=0;i<6;i++)
{
Serial.println(10000 + i + 1); //prefix
Serial.println(value[i]);
Serial.println(10010); //end signal
}
// wait for a bit to not overload the port
delay(10);
}
Cheers,
Adam.