Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int actuators = 3;
- int stepsCount = 10;
- 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] = {0,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 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++)
- {
- for(int i =0; i<actuators; i++)
- {
- int currentTempState = actuatorArrayStep[i] + currentStep;
- actuatorState = arrayFromGoogleSheets[currentTempState];
- // TurnActuator(i, actuatorState);
- if(actuatorState)
- cout << "motor: " << i <<" true \n";
- else
- cout << "motor: " << i <<" false \n";
- }
- currentStep++;
- }
- //}
- }
Advertisement
Add Comment
Please, Sign In to add comment