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:
- 4:1247fae2410a
- Parent:
- 3:82cf87db7ef4
- Child:
- 5:4c120fde3e73
diff -r 82cf87db7ef4 -r 1247fae2410a main.cpp
--- a/main.cpp Tue Nov 13 13:51:15 2012 +0000
+++ b/main.cpp Fri Nov 16 05:42:17 2012 +0000
@@ -20,37 +20,37 @@
{
meter_LED_outside = 0;
wait_ms(100);
- meter_LED_outside = 0.8;
+ meter_LED_outside = 0.1;
wait_ms(100);
meter_LED_outside = 0;
wait_ms(100);
- meter_LED_outside = 0.8;
+ meter_LED_outside = 0.1;
wait_ms(100);
meter_LED_outside = 0;
wait_ms(100);
- meter_LED_outside = 0.8;
+ meter_LED_outside = 0.1;
}
void meter_LED_outside_flashing2()
{
meter_LED_outside = 0;
wait_ms(100);
- meter_LED_outside = 0.8;
+ meter_LED_outside = 0.1;
wait_ms(100);
meter_LED_outside = 0;
wait_ms(100);
- meter_LED_outside = 0.8;
+ meter_LED_outside = 0.1;
wait_ms(100);
meter_LED_outside = 0;
wait_ms(100);
- meter_LED_outside = 0.8;
+ meter_LED_outside = 0.1;
wait_ms(100);
meter_LED_outside = 0;
wait_ms(100);
- meter_LED_outside = 0.8;
+ meter_LED_outside = 0.1;
wait_ms(100);
meter_LED_outside = 0;
wait_ms(100);
- meter_LED_outside = 0.8;
+ meter_LED_outside = 0.1;
}
int main()
@@ -65,6 +65,13 @@
server.listen();
meter_LED_outside.period_ms (1);
+
+ P_range_LED = 0.5;
+ wait(0.5);
+ P_range_LED = 0.0;
+ P_range_LED = 0.5;
+ wait(0.5);
+ P_range_LED = 0.0;
while (1) {
TCPSocketConnection client;
@@ -81,27 +88,27 @@
switch (mode) {
case 0:
- for(float p = 0.0f; p < 1.0f; p += 0.02f) {
+ for(float p = 0.0f; p < 0.8f; p += 0.02f) {
meter_LED_outside = p;
wait(0.01);
}
- for(float p = 0.0f; p < 1.0f; p += 0.02f) {
+ for(float p = 0.0f; p < 0.8f; p += 0.02f) {
meter_LED_inside = p;
wait(0.01);
}
- for(float p = 0.0f; p < 1.0f; p += 0.02f) {
+ for(float p = 0.0f; p < 0.8f; p += 0.02f) {
P_range_LED = p;
wait(0.01);
}
- for(float p = 0.0f; p < 1.0f; p += 0.02f) {
+ for(float p = 0.0f; p < 0.8f; p += 0.02f) {
D_range_LED = p;
wait(0.01);
}
- for(float p = 0.0f; p < 1.0f; p += 0.02f) {
+ for(float p = 0.0f; p < 0.8f; p += 0.02f) {
Other_range_LED = p;
wait(0.01);
}
- for(float p = 0.0f; p < 1.0f; p += 0.02f) {
+ for(float p = 0.0f; p < 0.8f; p += 0.02f) {
needle_LED = p;
wait(0.01);
}
@@ -125,13 +132,13 @@
wait (0.5);
signal_LED_L = 0;
signal_LED_R = 0;
- wait (1);
+ needle_LED = (1.0);
+ wait (3.5);
- for(float p = 0.0f; p < 0.2f; p += 0.01f) {
+ for(float p = 0.0f; p < 0.1f; p += 0.01f) {
meter_LED_outside = p;
meter_LED_inside = p;
P_range_LED = p;
- needle_LED = (p + 0.8);
wait(0.05);
}
digitalclock = 1;
@@ -152,19 +159,19 @@
break;
}
if (buffer[0] == 'P') {
- meter_LED_outside = ((target / 10.0)-0.2);
+ meter_LED_outside = ((target / 10.0));
} else if (buffer[0] == 'Q') {
- meter_LED_inside = ((target / 10.0)-0.2);
+ meter_LED_inside = ((target / 10.0));
} else if (buffer[0] == 'R') {
- needle_LED = ((target / 10.0)-0.2);
+ needle_LED = ((target / 10.0));
} else if (buffer[0] == 'C') {
int count_1 = 0;
int t = 0;
P_range_LED = 0;
- D_range_LED = 1;
- while(count_1 < 7) {
+ D_range_LED = 0.1;
+ while(count_1 < 8) {
if (t ==0) {
- wait(19.2);
+ wait(10.0);
meter_LED_outside_flashing1();
} else if (t == 1) {
wait_ms(2500-700);
@@ -176,14 +183,18 @@
wait_ms(2500-700);
meter_LED_outside_flashing1();
} else if (t == 4) {
- wait_ms(4300-700);
+ wait_ms(4000-700);
meter_LED_outside_flashing2();
} else if (t == 5) {
- wait_ms(4600-700);
+ wait_ms(4000-700);
meter_LED_outside_flashing2();
} else if (t == 6) {
- wait_ms(5700-700);
+ wait_ms(6000-700);
meter_LED_outside_flashing2();
+ } else if (t == 7) {
+ wait(36);
+ D_range_LED = 0;
+ P_range_LED = 0.1;
t = 0;
}
wait_ms(200);
@@ -241,7 +252,7 @@
wait (0.5);
signal_LED_L = 0;
signal_LED_R = 0;
- } else if (buffer[0] == 'L') {
+ } else if (buffer[0] == 'M') {
signal_LED_R = 1;
wait (0.5);
signal_LED_R = 0;
@@ -261,6 +272,10 @@
signal_LED_R = 1;
wait (0.5);
signal_LED_R = 0;
+ } else if (buffer[0] == 'S') {
+ meter_LED_outside = 0.1;
+ meter_LED_inside = 0.1;
+ needle_LED = 1.0;
}
}
digitalclock_colon = 1;
