Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Revision 0:08d7440bdf68, committed 2020-10-15
- Comitter:
- henriquer
- Date:
- Thu Oct 15 21:13:21 2020 +0000
- Commit message:
- ADC-DAC-Sinal Audio
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Oct 15 21:13:21 2020 +0000
@@ -0,0 +1,49 @@
+
+// #################### DAC F302 ####################
+
+#include "mbed.h"
+
+AnalogIn Ain(A0); // Entrada sinal de áudio
+
+AnalogOut Aout(A2); // Reconstrução -sinal de áudio
+
+Ticker snyq_tick;
+
+
+void snyq_task(void);
+
+
+float data_in, data_out;
+
+int main()
+{
+ snyq_tick.attach_us(&snyq_task,25); // tempo de amostragem do sinal 1/25us
+}
+// Funcção Amostragem do Sinal - DAC
+void snyq_task(void)
+{
+ data_in=Ain;
+ data_out=data_in;
+ Aout=data_out;
+
+}
+
+//float LPF(float LPF_in)
+//{
+//float a[4]= {1,2,1};
+
+//float b[4]= {1,2,1};
+//static float LPF_out;
+//static float x[4], y[4];
+//x[3] = x[2];
+//x[2] = x[1];
+//x[1] = x[0]; // move x values by one sample
+//y[3] = y[2];
+//y[2] = y[1];
+//y[1] = y[0]; // move y values by one sample
+// x[0] = LPF_in; // new value for x[0]
+// y[0] = (b[0]*x[0]) + (b[1]*x[1]) + (b[2]*x[2]) + (b[3]*x[3]) + (a[1]*y[1]) + (a[2]*y[2]) + (a[3]*y[3]);
+
+//LPF_out = y[0];
+//return LPF_out; // output filtered value
+//}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Oct 15 21:13:21 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file