|
Algorithm 1 Distributed LED brightness control algorithm |
-
1:
Initialize for , , and desired error tolerance
-
2:
N: number of clients
-
3:
Initialize according to user requirements, for
-
4:
#sensor calibration:
-
5:
For , send to client i
-
6:
For , receive from client i
-
7:
For , send to client i
-
8:
For , receive from client i
-
9:
#LED brightness control:
-
10:
If a value is received from a client i:
-
11:
While True:
-
12:
-
13:
If :
-
14:
Break
-
15:
Send to client i
-
16:
Else
-
17:
Wait for from a client i
|