Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int actuators = 6; // 3
- int stepsCount = 10; // Tova ne ni trqbva tuk
- int stepsDuration = 100;
- // int arrayFromGoogleSheets[20] = {0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0};
- //int arrayFromGoogleSheets[30] = {1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1};
- int arrayFromGoogleSheets[60] = {1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0};
- // 6250200008111111110000000000000000000000000000000000000000000000000000
- int actuatorArrayStep[40];
- int currentStep = 0;
- int actuatorState;
- void SetArray()
- {
- for(int i =0; i<actuators;i++)
- {
- actuatorArrayStep[i] = stepsCount*i; // 1
- }
- }
- /* void TurnActuator(int actuator, int state)
- {
- //digitalWrite(actuator, state);
- }
- */
- int main()
- {
- SetArray();
- // if(stepsDuration >= currentMillis-previousMillis)
- // {
- for(int k = 0; k<stepsCount; k++)
- {
- cout << "LOOP CYCLE: " << k << endl;
- for(int i =0; i<actuators; i++)
- {
- int currentTempState = actuatorArrayStep[i] + currentStep;
- actuatorState = arrayFromGoogleSheets[currentTempState];
- // TurnActuator(i, actuatorState);
- if(actuatorState == 1)
- cout << "motor: " << i <<" true \n";
- else
- cout << "motor: " << i <<" false \n";
- }
- currentStep++;
- }
- //}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement