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: EthernetInterface mbed-rtos mbed
Diff: main.cpp
- Revision:
- 1:95407c4ef69e
- Parent:
- 0:e0c9a84c55c9
- Child:
- 2:c1d4ea63ab89
diff -r e0c9a84c55c9 -r 95407c4ef69e main.cpp
--- a/main.cpp Wed Nov 07 11:12:10 2012 +0000
+++ b/main.cpp Thu Nov 08 07:41:57 2012 +0000
@@ -31,6 +31,7 @@
int i = 0;
//int j = 0;
+ int mode = (buffer[0] - 'A');
while (1) {
TCPSocketConnection client;
@@ -43,14 +44,17 @@
int n = client.receive(buffer, sizeof(buffer));
if (n > 0) {
- int target = (buffer[1] - '0') * 100 + (buffer[2] - '0') * 10 + (buffer[3] - '0');
-
+ //int target = (buffer[1] - '0') * 100 + (buffer[2] - '0') * 10 + (buffer[3] - '0');
+ if (i == 1) {
+ while (1) {
+ digitalclock_colon = 1;
+ wait (0.5);
+ digitalclock_colon = 0;
+ wait (0.5);
+ }
+ }
if (buffer[0] == 'A') {
- digitalclock = 1;
- digitalclock_colon = 1;
- wait (0.5);
- digitalclock_colon = 0;
- wait (0.5);
+
if (i <= 0) {
for(float p = 0.0f; p < 1.0f; p += 0.01f) {
meter_LED_outside = p;
@@ -102,7 +106,8 @@
needle_LED = (p + 0.8);
wait(0.05);
}
- i++;
+ i = 1;
+ digitalclock = 1;
}
} else if (buffer[0] == 'B') {
digitalclock = 0;
@@ -116,13 +121,15 @@
needle_LED = p;
wait(0.01);
}
+ } else if (buffer[0] == 'F') {
+ meter_LED_outside = (target / 10.0)-0.2;
+ } else if (buffer[0] == 'G') {
+ meter_LED_inside = (target / 10.0)-0.2;
+ }
- } else if (buffer[0] == 'F') {
- meter_LED_outside = target / 10.0;
- } else if (buffer[0] == 'G') {
- meter_LED_inside = target / 10.0;
- }
}
}
}
-}
\ No newline at end of file
+}
+
+
