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.
Revision 1:1895d2877fef, committed 2019-10-15
- Comitter:
- jvicente
- Date:
- Tue Oct 15 15:09:15 2019 +0000
- Parent:
- 0:d8bdd80b93fe
- Commit message:
- cambio delay
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Oct 15 14:21:57 2019 +0000
+++ b/main.cpp Tue Oct 15 15:09:15 2019 +0000
@@ -1,6 +1,8 @@
#include "mbed.h"
#define bufferLength 256
+Serial pc(USBTX, USBRX,115200); // tx, rx
+
AnalogIn analog_value(A0);
Ticker tMuestrea;
int flag=0;
@@ -10,16 +12,17 @@
int main()
{
+
tMuestrea.attach(&muestrea, 0.001);
printf("\nAnalogIn example\n");
while(1) {
if (flag) {
for (int n=0; n<bufferLength; n++) {
- printf("%d\n",buffer[n]);
+ pc.printf("%d\n",buffer[n]);
}
flag=0;
}
- wait(1);
+ wait_us(1);
}
}