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.
Diff: main.cpp
- Revision:
- 1:0b3ef7a962cb
- Parent:
- 0:e3fec6da521a
- Child:
- 2:3db66088534c
diff -r e3fec6da521a -r 0b3ef7a962cb main.cpp
--- a/main.cpp Fri Sep 20 17:08:52 2019 +0000
+++ b/main.cpp Fri Sep 20 17:18:16 2019 +0000
@@ -3,17 +3,17 @@
Serial pc(SERIAL_TX, SERIAL_RX,230400);
Serial mega(PC_10, PC_11);
+Ticker uart;
const uint8_t num_limit = 64;
char receivedChars[num_limit];
-bool newData = false;
-float SharpIr[2];
char dataClean[num_limit];
-double dataOut[81];
+float dataOut[81];
float floatTemp;
float out;
bool cond;
-bool rec;
- int Y;
+bool newData = false;
+int Y;
+
void Sentmega(uint8_t DataSent)
{
if (mega.writeable() > 0)
@@ -206,7 +206,12 @@
}
}
- pc.printf("DONE \n");
+ wait(0.1);
+ for (int k=0;k<81;k++)
+ {
+ Y=k+1;
+ pc.printf("Data ke %d : %.3f \n",Y,dataOut[k]);
+ }
}
@@ -215,22 +220,18 @@
int main()
{
pc.printf("Serial receiver V2");
+ uart.attach(&upSensor,1.0);
wait(0.5);
mega.baud(115200);
while (1)
{
-
+
// showNewData();
- upSensor();
- wait(0.1);
- for (int k=0;k<81;k++)
- {
- Y=k+1;
- pc.printf("Data ke %d : %.3f \n",Y,dataOut[k]);
- }
- wait(3);
+ //upSensor();
+
+ wait(0.001);
//dataOut[0]=floatTemp;
- //pc.printf("%.2f \n", floatTemp);
+ pc.printf("MAIN");
//wait(0.5);
}
}