Elektronikprojekt Grupp 13 / Mbed OS test_fft_grp13

Dependencies:   mbed-dsp

Fork of mbed-os-example-blinky by Elektronikprojekt Grupp 13

main.cpp

Committer:
deeza
Date:
2017-03-29
Revision:
44:7f2c1e8d0761
Parent:
39:c92c150c0dd2
Child:
45:b1b431753adc

File content as of revision 44:7f2c1e8d0761:

#include "mbed.h"

DigitalOut led1(LED1);

// State machine
int    STATE;
const int NONE     = -1;
const int TEST  = 0;
const int SEND     = 1;
const int DSP1     = 2;
const int DSP2     = 3;
const int DSP3     = 4;
const int WAIT     = 9;

// main() runs in its own thread in the OS
int main() {
    STATE = NONE;
    while (true) {
        switch (STATE) {
            
            case SEND:
            //send code here
            break;
            
            case TEST:
            //code here
            break; 
            
            }
    }
}
//Calculating distanse between sound and camera
double calcDis(double t, double v){
    double s = t*v;
    return s;
    
}
//Calculating angle in radians, D distanse between mic1 and mic2
double calcAng(double s, double D){
    double ang = asin(s/D);
    return ang;
}

//Presuming the input value is temp as a nuber and humidity as procent
double speedofsound(double temp, double hum){
    //Calculations done in Matlab
    speed = 331.1190 + 0.6016*temp + 0.0126*hum;
    return speed;
}