Vjezba_sinus

Dependencies:   mbed

main.cpp

Committer:
miljkovic
Date:
2015-12-10
Revision:
0:35f1fb764f89

File content as of revision 0:35f1fb764f89:

#include "mbed.h"
 
#define INPUT_SCALAR        (0.01f) 
 
AnalogIn Ain(p20);
AnalogOut Aout(p18);
float i;
float pi=3.14159;
 
int main()
{
    while(1)  {
        for (i=0; i<2; i=i+0.005) {
                                    Aout=0.5+0.5*sin(i*pi);
                                    wait(Ain*INPUT_SCALAR); 
            
        }
    }
}