You are viewing an older revision! See the latest version

Sparkfun MyoWare Muscle Sensor

The MyoWare muscle senor

The sparkfun MyoWare muscle sensor kit can be purchased from Sparkfun or Adafruit.

The datasheet can be located Here.

Wiring

MBEDMyoWare
VOUT+
GND-
AnalogInSIG

Simple Test

This is a simple program to output the values of the sensor to your pc terminal. Gives values scaled between 0 and 1.

#include "mbed.h"

Serial pc(USBTX, USBRX); // tx, rx
AnalogIn sig(p15);       // Gives the rectified and integrated EMG signal

//This is a simple test of the myoware muscle sensor
int main() {
    
    while(1) {
        float sig_val = sig;
        pc.printf("Sig Value: %f\n\r", sig_val);    
        wait(1);
    }
    
}

Using the Cable Shield

Replacing the LED Shield

#include "mbed.h"

Serial pc(USBTX, USBRX); // tx, rx
AnalogIn sig(p15);       // Gives the rectified and integrated EMG signal
DigitalOut led1(LED1);
DigitalOut led2(LED2);
DigitalOut led3(LED3);
DigitalOut led4(LED4);

//This is a simple test of the myoware muscle sensor
int main() {
    led1=0;
    led2=0;
    led3=0;
    led4=0;
    while(1) {
        float sig_val = sig;
        pc.printf("Sig Value: %f\n\r", sig_val); 
        if(sig_val>0 && sig_val <.25) {
            led1=1;
            led2=0;
            led3=0;
            led4=0; 
        } else if (sig_val>=.25 && sig_val <.50) {
            led1=1;
            led2=1;
            led3=0;
            led4=0;     
        } else if (sig_val >= .50 && sig_val <.75) {
            led1=1;
            led2=1;
            led3=1;
            led4=0;    
        } else if (sig_val >= .75 && sig_val<1) {
            led1=1;
            led2=1;
            led3=1;
            led4=1;     
        }
        wait(1);
    }
    
}

Digital Out

Using the API


All wikipages