MyoWare Sensor / MyoWare
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "MyoWare.h"
00003  
00004 Serial pc(USBTX, USBRX); // tx, rx
00005 //AnalogIn sig(p15);       // Gives the rectified and integrated EMG signal
00006 
00007 float logic = 0.7f; 
00008 int steps = 20;
00009 MyoWare ms(p15, logic, steps);
00010 
00011 //This is a simple test of the myoware muscle sensor
00012 int main() {
00013     
00014     while(1) {
00015         float sig_val = ms.read();
00016         bool onOff = ms.control();
00017         int stepNum = ms.magnitude();
00018         //float sect = float(steps/100.0f);
00019         
00020         
00021         
00022         pc.printf("Sig Value: %f\n\r", sig_val);  
00023         pc.printf("Logic Value: %f\n\r", logic);  
00024         pc.printf("Digital Value: %d\n\r", onOff); 
00025         pc.printf("Total Steps: %d\n\r", steps);
00026         pc.printf("Step Value Value: %d\n\r", stepNum); 
00027         //pc.printf("temp Value Value: %d\n\r", temp); 
00028         //pc.printf("sect Value Value: %f\n\r", sect); 
00029         pc.printf("\n\r"); 
00030         wait(2);
00031     }
00032     
00033 }