Puchogenso
Dependencies: mbed-rtos mbed C12832
Revision 1:6f592335f935, committed 2017-11-07
- Comitter:
- Sumobot
- Date:
- Tue Nov 07 16:29:27 2017 +0000
- Parent:
- 0:2124db616035
- Commit message:
- Xop
Changed in this revision
C12832.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 2124db616035 -r 6f592335f935 C12832.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C12832.lib Tue Nov 07 16:29:27 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/askksa12543/code/C12832/#990d5eec2ef6
diff -r 2124db616035 -r 6f592335f935 main.cpp --- a/main.cpp Tue Oct 31 17:28:45 2017 +0000 +++ b/main.cpp Tue Nov 07 16:29:27 2017 +0000 @@ -1,37 +1,81 @@ -/*#include "mbed.h" +#include "mbed.h" +#include "rtos.h" +#include "C12832.h" -AnalogOut Aout(p18); -int *lugar; - -int main() { //Inicializa los hilos de "pulso" y "calculo"; además, tras cada flanco de subida detectado, envía a la interrupción "cuenta" - //thread.start(triangular); - while(1) - { - Aout=0.5; - wait(.050); - Aout=0; - wait(.050); - } -}*/ - -#include "mbed.h" - +C12832 lcd(p5, p7, p6, p8, p11); Timer t; -int array[5]; -int H[5]; +float Xop[4]; +float Hop[4]; +int h, f=-3; +float a=0, b, c=0, d=0, e=0, w=0, g=0, r=0, s=0, z=0, u=0, v=0, x=0, y=0; +Thread Muestreo, senal; AnalogOut Aout(p18); +void seno() {} + + + int main () { - t.start(); - while (1) { - while (t.read() < 0.5) { - for (int i = 0; i<5; i++) { - array[i] = i; - H[i] = array[i]*2; - Aout = array[i]/2; - wait(0.1); - } + lcd.cls(); + lcd.locate(0,3); + senal.start(seno); + + for (int i = 0; i<5; i++){ + b=3*sin(2000*3.1416*i*0.000125); + Aout = b; + Xop[i]= b; + Thread::wait(.125); + //lcd.printf("El valor es %.2f", Xop[1]); + } + + for (int j = 3; j>-1; j--){ + h= 2*j; + Hop[f]=h; + //lcd.printf("El valor es %.2f", Hop[f]); + f=f+1; + } + + Thread::wait(3000); + + //for (int k = 1; k<3; k++) { + lcd.printf("El valor es %.1f", Xop[0]); + lcd.printf("El valor es %.1f", Xop[1]); + lcd.printf("El valor es %.1f", Xop[2]); + lcd.printf("El valor es %.1f", Xop[3]); + + /*d = d + c; + } + for (int k = -3; k<7; k++) { + e = X[k]*Hop[k-3]; + //lcd.printf("El valor es %.1f", e); + w = w + e; } - t.reset(); + for (int k = -3; k<7; k++) { + g = X[k]*Hop[k-4]; + //lcd.printf("El valor es %.1f", g); + r = r + g; + } + for (int k = -3; k<7; k++) { + s = X[k]*Hop[k-5]; + //lcd.printf("El valor es %.1f", s); + z=z+s; + } + for (int k = -3; k<7; k++) { + u = X[k]*Hop[k-6]; + //lcd.printf("El valor es %.1f", u); + v=v+u; + } + for (int k = -3; k<7; k++) { + x = X[k]*Hop[k-7]; + //lcd.printf("El valor es %.1f", x); + y=y+x; + }*/ + while (1) { + //lcd.printf("El valor es %.f", d); + /*lcd.printf("El valor es %.1f", w); + lcd.printf("El valor es %.1f", r); + lcd.printf("El valor es %.1f", z); + lcd.printf("El valor es %.1f", v); + lcd.printf("El valor es %.1f", y);*/ } } \ No newline at end of file