MyoWare Sensor / MyoWare

main.cpp

Committer:
cturner48
Date:
2017-03-08
Revision:
2:61ec418c186c
Parent:
0:7bb1367b48b8

File content as of revision 2:61ec418c186c:

#include "mbed.h"
#include "MyoWare.h"
 
Serial pc(USBTX, USBRX); // tx, rx
//AnalogIn sig(p15);       // Gives the rectified and integrated EMG signal

float logic = 0.7f; 
int steps = 20;
MyoWare ms(p15, logic, steps);

//This is a simple test of the myoware muscle sensor
int main() {
    
    while(1) {
        float sig_val = ms.read();
        bool onOff = ms.control();
        int stepNum = ms.magnitude();
        //float sect = float(steps/100.0f);
        
        
        
        pc.printf("Sig Value: %f\n\r", sig_val);  
        pc.printf("Logic Value: %f\n\r", logic);  
        pc.printf("Digital Value: %d\n\r", onOff); 
        pc.printf("Total Steps: %d\n\r", steps);
        pc.printf("Step Value Value: %d\n\r", stepNum); 
        //pc.printf("temp Value Value: %d\n\r", temp); 
        //pc.printf("sect Value Value: %f\n\r", sect); 
        pc.printf("\n\r"); 
        wait(2);
    }
    
}