Write a program to control a set of 10 motors; the motors are operating under load balancing mechanism as
follows:
• Motors operate in pairs as follows: 1,10 then 2, 9 then 3,8 then 4,7 then 5,6 then repeat.
• The operating duration for each pair is 10,000 milliseconds.
• After each operating cycle, all motors must be OFF for 10,000 milliseconds then a new cycle starts.
• The operating sequence is running 24/7.
#include <iostream>
using namespace std;
int main () {
int motors[2][10] = {{1, 10}, {2, 9}, {3, 8}, {4, 7}, {5, 6}, {6, 5}, {7, 4}, {8, 3}, {9, 2}, {10, 1}};
int operatingDuration = 10000;
int cycleDuration = 10000;
int timeDuration = 86400;
}
Comments
Leave a comment